CreateAction::make()
->label('New Sending Domain')
->color('purple')
->icon('heroicon-m-shield-check')
->modalWidth(Width::Medium)
->stickyModalFooter()
->stickyModalHeader()
->schema(SendingDomainFormSchema::makeForm())
->action(function (array $data, Action $action) {
try {
$messages = [];
if (! empty($messages)) {
throw ValidationException::withMessages([
'domain' => 'Some error message',
]);
}
} catch (ValidationException $e) {
throw $e;
} catch (Throwable $e) {
flashSweetAlert('Something went wrong while saving sending domain. Please try again.');
report($e); // optional but strongly recommended
$action->halt();
}
flashSweetAlert('Sending domain saved successfully.', 'success');
});
CreateAction::make()
->label('New Sending Domain')
->color('purple')
->icon('heroicon-m-shield-check')
->modalWidth(Width::Medium)
->stickyModalFooter()
->stickyModalHeader()
->schema(SendingDomainFormSchema::makeForm())
->action(function (array $data, Action $action) {
try {
$messages = [];
if (! empty($messages)) {
throw ValidationException::withMessages([
'domain' => 'Some error message',
]);
}
} catch (ValidationException $e) {
throw $e;
} catch (Throwable $e) {
flashSweetAlert('Something went wrong while saving sending domain. Please try again.');
report($e); // optional but strongly recommended
$action->halt();
}
flashSweetAlert('Sending domain saved successfully.', 'success');
});