Файловый менеджер - Редактировать - /var/www/html/back/app/Domain/Project/CqrsServiceProvider.php
Назад
<?php declare(strict_types=1); namespace App\Providers; use App\Buses\CommandBus; use App\Buses\QueryBus; use App\Contracts\CommandBusContract; use App\Contracts\QueryBusContract; use App\Domain\Object\Handlers\Read\GetAllPaymentsQueryHandler; use App\Domain\Object\Handlers\Read\GetPaymentByIdQueryHandler; use App\Domain\Payment\Queries\GetAllPaymentsQuery; use App\Domain\Payment\Queries\GetPaymentByIdQuery; use Illuminate\Support\ServiceProvider; final class CqrsServiceProvider extends ServiceProvider { /** * Register any application services. */ public function register(): void { $this->app->singleton( abstract: CommandBusContract::class, concrete: CommandBus::class ); $this->app->singleton( abstract: QueryBusContract::class, concrete: QueryBus::class ); } /** * Bootstrap any application services. */ public function boot(): void { app(abstract: QueryBusContract::class)->register(map: [ GetAllPaymentsQuery::class => GetAllPaymentsQueryHandler::class, GetPaymentByIdQuery::class => GetPaymentByIdQueryHandler::class, ]); } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.30 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка