Table row action not working

Good morning, I have a filament table on a custom livewire page in which I want to put a row action. So I did just that according to the documentation. But when I click the action in the table it shows a short loading icon and then does nothing. What does work is if I put ->url('someurl')->openUrlInNewTab(). So it definitely triggers the action, but it doesn't reach the ->action() method for some reason. I have a feeling it might have to do with that the results are based on a query and not a model. But I'm not sure. So any help would be appreciated. The table query:
public function table(Table $table): Table
{
return $table
->query(
$this->team->members()->getQuery()
)
public function table(Table $table): Table
{
return $table
->query(
$this->team->members()->getQuery()
)
The action:
->actions([ \Filament\Tables\Actions\Action::make('DissociateTeamMember')
->requiresConfirmation()
->hidden(!$this->isTeamAdmin)
->color('danger')
->icon('heroicon-o-x-mark')
->label('Teamlid verwijderen')
->action(function () {
dd('test');
}),
])
->actions([ \Filament\Tables\Actions\Action::make('DissociateTeamMember')
->requiresConfirmation()
->hidden(!$this->isTeamAdmin)
->color('danger')
->icon('heroicon-o-x-mark')
->label('Teamlid verwijderen')
->action(function () {
dd('test');
}),
])
4 Replies
cakan
cakan14mo ago
Have you found the solution? I have the same problem.
Vp
Vp14mo ago
Did you put <x-filament-actions::modals /> in blade file?
cakan
cakan14mo ago
Modals are working. The issue seems to be with the model is missing.
Vp
Vp14mo ago
I've check it just now and it seems to be working normally, the issues may be your query only. My codes:
public function table(Table $table): Table
{
return $table
->query(User::query())
->columns([
TextColumn::make('name'),
])
->paginated([5, 10, 25, 50, 100])
->defaultPaginationPageOption(5)
->actions([
Action::make('Go to home with new tab')
->url('/')
->openUrlInNewTab(),

Action::make('Open modal')
->requiresConfirmation()
->action(function (): void {
dd('Yay');
})
->color('success'),

Action::make('Without modal')
->action(function (): void {
dd('Yay without modal');
})
->color('danger'),
]);
}

// blade.php
<div>
{{ $this->table }}

<x-filament-actions::modals />
</div>
public function table(Table $table): Table
{
return $table
->query(User::query())
->columns([
TextColumn::make('name'),
])
->paginated([5, 10, 25, 50, 100])
->defaultPaginationPageOption(5)
->actions([
Action::make('Go to home with new tab')
->url('/')
->openUrlInNewTab(),

Action::make('Open modal')
->requiresConfirmation()
->action(function (): void {
dd('Yay');
})
->color('success'),

Action::make('Without modal')
->action(function (): void {
dd('Yay without modal');
})
->color('danger'),
]);
}

// blade.php
<div>
{{ $this->table }}

<x-filament-actions::modals />
</div>
Want results from more Discord servers?
Add your server