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:
->actions([
ActionGroup::make([
Action::make('follow')
->icon('heroicon-o-bell-alert')
->action(fn () => dd()),
]),
// ...
// ...
])
->actions([
ActionGroup::make([
Action::make('follow')
->icon('heroicon-o-bell-alert')
->action(fn () => dd()),
]),
// ...
// ...
])
Custom class action (also not working)
<?php

namespace App\Filament\Actions;

use Filament\Actions\Action;
use Filament\Notifications\Notification;
use Illuminate\Database\Eloquent\Model;

class FollowShowAction extends Action
{
public static function getDefaultName(): ?string
{
return 'follow-show';
}

protected function setUp(): void
{
parent::setUp();

$this->label('Follow Show')
->icon('heroicon-o-bell-alert')
->action(function (Model $record) {
Notification::make()
->title('Show followed')
->success()
->send();
});
}
}
<?php

namespace App\Filament\Actions;

use Filament\Actions\Action;
use Filament\Notifications\Notification;
use Illuminate\Database\Eloquent\Model;

class FollowShowAction extends Action
{
public static function getDefaultName(): ?string
{
return 'follow-show';
}

protected function setUp(): void
{
parent::setUp();

$this->label('Follow Show')
->icon('heroicon-o-bell-alert')
->action(function (Model $record) {
Notification::make()
->title('Show followed')
->success()
->send();
});
}
}
3 Replies
Pekempy
Pekempy7d ago
Also - to confirm I'm on latest version:
No description
awcodes
awcodes7d ago
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.
Pekempy
Pekempy7d ago
Note to self, sleep when it's 1am 😂 thank you.