FilamentF
Filament13mo ago
Eskie

replaceMountedAction

How to use replaceMountedAction on resource?
Solution
I think you need to add the sendMoneyConfirmation method to the ListPage

->headerActions([
    Tables\Actions\Action::make('sendMoney')
        ->form([
            //...
            TextInput::make('amount'),
        ])
        ->action(function (array $data, array $arguments, Page $livewire) {
            $livewire->replaceMountedAction('sendMoneyConfirmation');
        }),
])


ListXX.php
public function sendMoneyConfirmationAction(): Action
{
    return Action::make('sendMoneyConfirmation')
        ->requiresConfirmation()
        ->action(function (array $arguments) {
            //...
        });
}
Was this page helpful?