feat: updates
This commit is contained in:
23
app/Actions/Ledgers/CreateLedgerAction.php
Normal file
23
app/Actions/Ledgers/CreateLedgerAction.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Actions\Ledgers;
|
||||
|
||||
use App\Actions\BaseAction;
|
||||
use App\Commands\Ledgers\CreateLedgerCommand;
|
||||
use App\DataObjects\CreateLedgerDTO;
|
||||
use Closure;
|
||||
use Spatie\LaravelData\Data;
|
||||
|
||||
class CreateLedgerAction extends BaseAction
|
||||
{
|
||||
public function __construct(
|
||||
private readonly CreateLedgerCommand $createLedgerCommand,
|
||||
) {}
|
||||
|
||||
public function __invoke(CreateLedgerDTO|Data $payload, Closure $next)
|
||||
{
|
||||
$this->createLedgerCommand->execute($payload->data);
|
||||
|
||||
return $next($payload);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user