upgrade to filament v4
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
|
||||
namespace App\Actions\Transmittal;
|
||||
|
||||
use Closure;
|
||||
use Exception;
|
||||
use LogicException;
|
||||
use App\Actions\BaseAction;
|
||||
use App\Commands\Transmittal\StoreTransmittalCommand;
|
||||
use App\DataObjects\CreateTransmittalDTO;
|
||||
@@ -15,15 +18,15 @@ class CreateTransmittal extends BaseAction
|
||||
private readonly StoreTransmittalCommand $storeTransmittalCommand
|
||||
) {}
|
||||
|
||||
public function __invoke(CreateTransmittalDTO | Data $payload, \Closure $next)
|
||||
public function __invoke(CreateTransmittalDTO | Data $payload, Closure $next)
|
||||
{
|
||||
try {
|
||||
$payload->transmittal = $this->storeTransmittalCommand->execute(Arr::except($payload->data, ['files']));
|
||||
|
||||
return $next($payload);
|
||||
} catch (\Exception $exception)
|
||||
} catch (Exception $exception)
|
||||
{
|
||||
throw new \LogicException('Error creating transmittal: ' . $exception->getMessage());
|
||||
throw new LogicException('Error creating transmittal: ' . $exception->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user