Table rows Action->action() not firing
I have the below snippet (along with a few other actions) and I had initially been trying with
\Log::info('test');
, but it wasn't being fired so I thought I'd try dd()
and it seems that the ->action part is never being reached at all.
I tried duplicating another custom Action class class FollowShowAction extends Action {...}
and just changing the ->action() to trigger a Notification, but it's still not firing, however the original custom Action I cloned from class BlockUserAction extens Action {...}
works perfectly fine
I've also shared the custom class action I created below.
If I \Log::info('anything');
in the setUp()
function, it logs correctly, and if I use ->url()
instead of ->action()
it works too. I just can't work out why it works for the action I duplicated from, but not this one
The attached video is of the snippet immediately below:
Custom class action (also not working)
3 Replies
Also - to confirm I'm on latest version:
You’re extending the wrong Action class. Since it’s in a table it needs to extend Filament\Tables\Actions\Action
Currently there are separate Action classes for tables, forms and actions that are used outside of tables and form. This is set to change in v4.
Honestly, I’m surprised it’s not throwing an exception.
Note to self, sleep when it's 1am 😂 thank you.