Delete Action Not Working
I am using a filament table component in my livewire application but the delete action instead redirects to the show details page
Solution:Jump to solution
```php
ActionTable::make('delete')
->label('Delete')
->requiresConfirmation()
->color('danger')...
12 Replies
you set a ->url(), this will tell the action to actually navigate to that route
I do set the action
other routes work fine
but customers.delete or customers.destroy
redirects to the show page
Why are you using a route? Why not ->action(fn($record) => $record->delete())
let me try that
But I need to pass the delete route name
Why?
because this is a livewire component I just used the filament table component
That makes no sense
to delete a record using an Action method doesn't require anything else beyond the above. Why do you feel you need to redirect?
You could send a notifcation too of course to let the users know it's been deleted.
okay trying it out sir
it works
how best should append the notification?
By using the notifications plugin?
https://filamentphp.com/docs/3.x/notifications/installation
Yeah I have notifications setup I use them during exports
I want to trigger it after this action
Solution
thank you
it works
thank you so much