How to set $record for Custom Action
I have an action that i want to easily use throughout my app and I am having issues figuring out how to set the record that is being used. Its working fine as. a table action as the record is passed automatically and even fine as a form action is a Property record, but lets say I have another form that is a User record that has a property relationship. I want to be able to use this action there, but unfortuantely i get a type mismatch issue as its trying to use the User model and not the Property model. Unfortunately its not as simple as setting ->record() on the action. This is what my current action looks like (simplified a bit): and I just call it with . Wish i could just do or whatever. Any suggestions?
1 Reply
Not ideal, but does work
Not the most flexible solution, but might have to be it. Would still prefer to be able to pass it when i call the action
Though i kind of need a way to get a property from the parent page too. Hmm
eh, this isnt reliable. need to find another way