Change action priority in clickable rows
Due to Model policies i have View actions and Edit actions, but when i have View action it changes the priority from edit to view, is there any way of changing that behaviour?
5 Replies
Are you talking about the resource? AFAIK it just goes to the first action in the list so just change their order I guess
or
->recordAction('edit')
on the tableyes but do to model policies giving a default like that could cause a unauthorized
->recordAction(fn ($record) => \Auth::user()->can('edit', $record) ? 'edit' : 'view')
I think you need to override
getTableRecordUrlUsing()
.oh, yeah like this maybe
you right
forgot about ->can()
Yeah thats one aproach
strange that im passing 'edit' to the recordAction and still goes to view