Open Modal after Action Execution to show the result

Is there any way to open a modal after execution to show bigger results like JSON/Large Text? If that's not possible, is there a way to keep the modal open when confirm button is clicked and set the value of a field in the modal form area?
3 Replies
jals65
jals652mo ago
I have the same problem. I'm doing an action with a form to create an api token.
Action::make('create_token')
->form([
TextInput::make('name')
->unique()
->required(),
DateTimePicker::make('expiration_date')
->required()
->minDate(now()->addHour()
])
->requiresConfirmation()
->action(function (array $data) {
$token = auth()->user()->createToken($data['name'], ['*'], new \DateTime($data['expiration_date']))->plainTextToken;
// Here then i want to open a new modal to show the $token value
})
Action::make('create_token')
->form([
TextInput::make('name')
->unique()
->required(),
DateTimePicker::make('expiration_date')
->required()
->minDate(now()->addHour()
])
->requiresConfirmation()
->action(function (array $data) {
$token = auth()->user()->createToken($data['name'], ['*'], new \DateTime($data['expiration_date']))->plainTextToken;
// Here then i want to open a new modal to show the $token value
})
I want to open a new modal after token it's created on ->action() to show the value of the token generated
jals65
jals655w ago
Thanks @Azorky, i'm going to review that
Want results from more Discord servers?
Add your server