-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't associate model to one which is creating #48
Comments
Have you added a rule for the relationship in the request class? We only fill the model with validated data, so if you don't validate the relationship field it won't be filled. |
Also, this is not correct on the
Not sure what that is (possible incorrect copy and paste?), as this should be used on a schema: |
Yeah, my bad, edited my message with the right one. |
True, forgot about this, everything works now, after I added the relation rule to the request. |
Using approach to test my create resource with relation route like here https://laraveljsonapi.io/docs/1.0/testing/resources.html#store-aka-create-testing
But unfortunately model wasn't associated, no error, just null instead of relation? Can you check this, can't figure it out, is it my mistake somewhere or it's a bug.
Worker model
Worker Schedule model
Worker Schedules schema
Worker Schedules resource
Request inside the test
Result
The text was updated successfully, but these errors were encountered: