45 lines
1.1 KiB
PHP
45 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Services\Category\CategoryService;
|
|
use App\Services\Category\CategoryServiceInterface;
|
|
use App\Services\QueryRequestModifiers\Category\CategoryFilter;
|
|
use App\Services\QueryRequestModifiers\Category\CategoryOrder;
|
|
use Illuminate\Foundation\Application;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class CategoryServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register services.
|
|
*/
|
|
public function register(): void
|
|
{
|
|
$this->app->singleton(CategoryFilter::class, function (Application $app) {
|
|
return new CategoryFilter();
|
|
});
|
|
|
|
$this->app->singleton(CategoryOrder::class, function (Application $app) {
|
|
return new CategoryOrder();
|
|
});
|
|
|
|
$this->app->singleton(CategoryServiceInterface::class, function (Application $app) {
|
|
return new CategoryService(
|
|
$this->app->get(CategoryFilter::class),
|
|
$this->app->get(CategoryOrder::class),
|
|
);
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Bootstrap services.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
//
|
|
}
|
|
}
|