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:
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.
Jump to solution
3 Replies
Solution
awcodes
awcodes8mo ago
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.
awcodes
awcodes8mo ago
V4 should address this though as the actions are getting streamlined.
ChrisHardie
ChrisHardieOP8mo ago
Thank you!
Want results from more Discord servers?
Add your server