How to get record model in ViewRecord action?
Hi! I'm trying to get the Model of the record in the
getActions()
function in the ViewRecord page. Is there a way to achieve this? I'm trying to make an action with a url that is dependent on a field of the model.4 Replies
Use Closure Customization
->url(fn ($record) => ...)
This returns an error:
Attempt to read property "name" on null
Creating an action like this:
Sorry, didn't see you're already on the page:
->url(fn ($livewire) => $livewire->record
Yes that fixes it, thank you very much!