© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•10mo ago•
10 replies
Liam

Open another form modal from a form modal

https://filamentphp.com/docs/3.x/actions/adding-an-action-to-a-livewire-component#chaining-actions

I have a CreateAction that lets users create personal access tokens.

After the token is created, I want to close the modal and show a new modal with the plain text token so they can copy it and only see it once.

I know we can chain actions in Filament PHP, but I get an error when I try to pass the token to a form. Could anyone help or share a suggestion? Thank you!
Adding an action to a Livewire component - Actions - Filament
Solution
What about this?

public function createAction(): Action
{
    return Action::make('create')
        ->form([
            TextInput::make('token')
                ->required(),
        ])
        ->action(function (array $data) {

            // Here you can handle the form submission

            $this->replaceMountedAction('showToken', $data);
        });
}

public function showTokenAction(): Action
{
    return Action::make('showToken')
        ->fillForm(fn (array $arguments): array => [
            'token' => $arguments['token'],
        ])
        ->form([
            TextInput::make('token')
                ->disabled(),
        ])
        ->modalSubmitAction(false)
        ->modalCancelActionLabel('Close');
}
public function createAction(): Action
{
    return Action::make('create')
        ->form([
            TextInput::make('token')
                ->required(),
        ])
        ->action(function (array $data) {

            // Here you can handle the form submission

            $this->replaceMountedAction('showToken', $data);
        });
}

public function showTokenAction(): Action
{
    return Action::make('showToken')
        ->fillForm(fn (array $arguments): array => [
            'token' => $arguments['token'],
        ])
        ->form([
            TextInput::make('token')
                ->disabled(),
        ])
        ->modalSubmitAction(false)
        ->modalCancelActionLabel('Close');
}
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Open modal with form from another form.
FilamentFFilament / ❓┊help
3y ago
open modal from another modal
FilamentFFilament / ❓┊help
3y ago
How to Open Another Modal from Action Modal?
FilamentFFilament / ❓┊help
3y ago
How to open a modal from a Form Wizard?
FilamentFFilament / ❓┊help
2y ago