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.
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');
}$this->record or $this->data i assume successRedirectUrl$this->data