FilamentF
Filament2y ago
MZX

Modify create button to do more than create

Am I doing this right?

I want to create the record, but also go to the checkout page.

protected function getCreateFormAction(): Action
    {
        return Action::make('pay')
            ->label('Pay')
            ->submit('create')
            ->action(function ($record) {
                $amount = $record->amount;
                return redirect()->route('create.checkout.session', ['amount' => $amount]);
            })
            ->color('success');
    }
Was this page helpful?