Re-using a custom action on both a form and a table
I have a custom action that performs an operation on a single model and displays a notification. If it extends
Filament\Tables\Actions\Action
then it works fine on a table record row, and if it extends Filament\Actions\Action
then it works fine on a model resource page header, but so far I haven't figured out how to have it work on both. Is this possible?Solution:Jump to solution
It’s not possible. Currently in v3 table actions, form actions and general actions have to be separate classes. But you could reference the actions functionality from a common source of truth via their ->action() modifier.
3 Replies
Solution
It’s not possible. Currently in v3 table actions, form actions and general actions have to be separate classes. But you could reference the actions functionality from a common source of truth via their ->action() modifier.
V4 should address this though as the actions are getting streamlined.
Thank you!