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
                ActionTable::make('delete')
                    ->label('Delete')
                    ->requiresConfirmation()
                    ->color('danger')
                    ->icon('heroicon-o-trash')
                    ->url(function ($record) {
                        return route('customers.delete', $record);
                    }),
Solution
ActionTable::make('delete')
                    ->label('Delete')
                    ->requiresConfirmation()
                    ->color('danger')
                    ->icon('heroicon-o-trash')
                    ->action(function ($record) {
                        // Delete the record
                        if($record->delete()) {
                          Notification::make()
                            ->title('Delete record ' . $record->id . ' successfully')
                            ->success()
                            ->send();
                        }
                    })
Was this page helpful?