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
ChesterS
ChesterS2mo ago
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 table
Firebat
FirebatOP2mo ago
yes but do to model policies giving a default like that could cause a unauthorized
ChesterS
ChesterS2mo ago
->recordAction(fn ($record) => \Auth::user()->can('edit', $record) ? 'edit' : 'view')
Mark
Mark2mo ago
I think you need to override getTableRecordUrlUsing().
Firebat
FirebatOP2mo ago
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
Want results from more Discord servers?
Add your server