Attempt to read property "users" on null #2535
Unanswered
eshbanbahadur
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to implement 'Many to Many' relationship in a default Laravel project but I only receive the following error:
"Attempt to read property "users" on null"
I even tried it with custom foreign keys but I did not get desired results and always get error message. I also know that this package not supports pivot tables for Many to Many relationships.
Please guide that how fix this issue
I have two models (user, role) and below is the code of my Models:
// USER MODEL
This is for ROLE Model
And this is the code of Home Controller:
Here is the Schema of my MongoDB
Please guide where is the issue
Thanks
Beta Was this translation helpful? Give feedback.
All reactions