Open an action from another action
I have the following InfoListAction:
Now when the
Actions::make([
Action::make('close_configuration')
->extraModalFooterActions(fn(Action $action): array => [
$action
->makeModalSubmitAction('createAnother', arguments: ['another' => true])
->label(__('machine-configurations.close and create new'))
->color('success'),
])
->requiresConfirmation()
->action(function (Machine $record, array $arguments, CloseMachineConfiguration $closeMachineConfiguration, Action $action) {
if ($record->activeMachineConfiguration === null) {
return false;
}
$closed = $closeMachineConfiguration($record->activeMachineConfiguration);
if (!$closed) {
$action->sendFailureNotification();
}
if ($closed) {
$action->sendSuccessNotification();
}
if (isset($arguments['another']) && $arguments['another']) {
}
return $closed;
})
])->fullWidth()Actions::make([
Action::make('close_configuration')
->extraModalFooterActions(fn(Action $action): array => [
$action
->makeModalSubmitAction('createAnother', arguments: ['another' => true])
->label(__('machine-configurations.close and create new'))
->color('success'),
])
->requiresConfirmation()
->action(function (Machine $record, array $arguments, CloseMachineConfiguration $closeMachineConfiguration, Action $action) {
if ($record->activeMachineConfiguration === null) {
return false;
}
$closed = $closeMachineConfiguration($record->activeMachineConfiguration);
if (!$closed) {
$action->sendFailureNotification();
}
if ($closed) {
$action->sendSuccessNotification();
}
if (isset($arguments['another']) && $arguments['another']) {
}
return $closed;
})
])->fullWidth()Now when the
anotheranother argument is set I want to open another action that is declared down later on