upgrade to filament v4

This commit is contained in:
Jp
2026-02-19 01:26:02 +08:00
parent 90c92650b7
commit b95f23f223
122 changed files with 3615 additions and 3379 deletions

View File

@@ -2,6 +2,9 @@
namespace App\Actions\Branch;
use Closure;
use Exception;
use LogicException;
use App\Actions\BaseAction;
use App\Commands\Series\CreateSeriesCommand;
use App\DataObjects\CreateBranchDTO;
@@ -15,7 +18,7 @@ class StoreBranchSeries extends BaseAction
private CreateSeriesCommand $createSeriesCommand
) {}
public function __invoke(CreateBranchDTO|Data $payload, \Closure $next)
public function __invoke(CreateBranchDTO|Data $payload, Closure $next)
{
try {
$seriesPayload = CreateSeriesDTO::from(['branch_id' => $payload->branch->id, 'series' => $payload->data['series'], 'is_start' => true]);
@@ -23,8 +26,8 @@ class StoreBranchSeries extends BaseAction
$payload->series = $this->createSeriesCommand->execute($seriesPayload->toArray());
return $next($payload);
} catch (\Exception $exception) {
throw new \LogicException('Failed to create branch series', $exception->getMessage());
} catch (Exception $exception) {
throw new LogicException('Failed to create branch series', $exception->getMessage());
}
}
}