taktik - laravel
This commit is contained in:
44
app/Providers/CommentServiceProvider.php
Normal file
44
app/Providers/CommentServiceProvider.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?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
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user