Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
peripherad
/
back
/
app
/
Domain
/
ArticleToProject
/
Requests
:
CqrsServiceProvider.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?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, ]); } }