CreateAction with form() how to use different model than the current one.
So I have a tasks table that lists different tasks and have actions that you can take on different resources. For example i have a task that it's "add track" and i have a form that creates tracks that i'm using in the manage tracks resource. I extracted it as a shared form and now i'm able to add it to this specific task as such:
When i click on the action button i get the following error
[object] (BadMethodCallException(code: 0): Call to undefined method App\Models\Task::trackArtists()
this is the track form schema:
I understand the problem and it's that the form its thinking that it needs to use the model from the current resource which is "tasks"
I tried something like this:
But not working.. am I missing something?
Is this possible to be able to tell the form on this action to use a different model?
Thanks1 Reply
Ok i managed to get the first part working and getting the form to display in the modal by doing this:
but now i get the same error when i create the record.