taktik-laravel-pohovor/app/Providers/CommentServiceProvider.php

45 lines
1.1 KiB
PHP
Raw Normal View History

2025-01-23 00:19:07 +01:00
<?php
declare(strict_types=1);
namespace App\Providers;
use App\Services\Comment\PostCommentService;
use App\Services\QueryRequestModifiers\Comment\CommentFilter;
use App\Services\QueryRequestModifiers\Comment\CommentOrder;
use App\Services\QueryRequestModifiers\Comment\CommentOrderDTO;
use Illuminate\Foundation\Application;
use Illuminate\Support\ServiceProvider;
class CommentServiceProvider extends ServiceProvider
{
/**
* Register services.
*/
public function register(): void
{
$this->app->singleton(CommentFilter::class, function (Application $app) {
return new CommentFilter();
});
$this->app->singleton(CommentOrder::class, function (Application $app) {
return new CommentOrder();
});
$this->app->singleton(PostCommentService::class, function (Application $app) {
return new PostCommentService(
$this->app->get(CommentFilter::class),
$this->app->get(CommentOrder::class),
);
});
}
/**
* Bootstrap services.
*/
public function boot(): void
{
//
}
}