Change click action on the whole row in list view
As normal, when clicking on a row in the list view, it redirects you to the edit page for the record. How do I change this action to a custom one?
I want to do the action below, when clicking on a record row instead of redirecting to edit page.
Tables\Actions\Action::make('show_location')
->action(function ($record){
$record->delete();
})
->icon('carbon-location')
->requiresConfirmation()
->modalHeading('Delete Inactive Product')
->modalDescription('Are you sure you'd like to delete this inactive product? This cannot be undone.')
->modalSubmitActionLabel('Yes, delete it')
->modalContent(fn ($record): View => view('components.location-shelf', ['record' => $record])),
0 Replies