How to Create an Action class that can be used on both Table and Form
Hi,
I have a pretty big action with form and form handling logic. I need to extract it to a class which can be used on both the Resource Table and the Resource Edit form.
2 Replies
Ok I just created a trait which i use in both actions. I dont get the ide completion but it works..
May be someone has better approach..
Here is an Example:
app/Filament/Actions/Form/ReceiveInvoicePayment.php
app/Filament/Actions/Table/ReceiveInvoicePayment.php
The trait:
app/Filament/Actions/Concerns/ReceivesInvoicePayment.php
That's the most common way I've seen people say they're doing it. Looks sensible to me! ... and that's the approach I'm using in my apps.