How do you add an action to the edit page of a resource's relation manager?
I'm using Filament v3. Can I add an action to a form? I only see a way to do it with tables. There are no pages to edit, like for resource pages. I tried to override getFormActions(), but it didn't work so probably doesn't exist for a relation manager. I want to add a reset button to the edit and create pages. Do I have to edit the vendor templates? Is there a way to add actions to relation manager forms? Thanks.
I figured out how to add an extra action button to the Edit modal form using extraModalFooterActions(), but still trying to figure out how to reset the form once it's clicked. Not sure if the parameters are correct for the chained action and after methods; I was using different ones to try refresh or reset the form data.
Tables\Actions\EditAction::make()
->extraModalFooterActions([
Tables\Actions\Action::make('customResetAction')
->label('Reset')
->action(function (RelationManager $livewire, array $data, ShareRequest $record, Get $get, Set $set) {
})
->after(function (RelationManager $livewire, array $data, ShareRequest $record, Get $get, Set $set) {
}),
]),
Looks like you can also use \Filament\Actions\Action as an extraModalFooterActions() action and call a function, but still haven't figured out how to refresh data.
Tables\Actions\EditAction::make()
->extraModalFooterActions([
\Filament\Actions\Action::make('customResetAction')
->label('Reset')
])
public function customResetAction()
{
}