How to call parent record in a nested form?
What I am trying to do:
I have a
AssignmentResource
that is a nested resource of the ProjectResource
. In my form I want to get the contacts of the project.
What I did:
Look at the code
My issue/the error:
I found a way to do it, but it gives me errors with PHPStan so I was wondering if there is a better / alternative way to do it.
Code:
Solution:Jump to solution
PHPStan will give errors in Laravel natively, ensure you are using Laravels IDE Helper too.
But the parentRecord is the recommended approach....
2 Replies
Solution
PHPStan will give errors in Laravel natively, ensure you are using Laravels IDE Helper too.
But the parentRecord is the recommended approach.
I'm using VSCode