Answer the question
In order to leave comments, you need to log in
Why is Call to a member function roles() on null?
Did the code Auth::user()->roles()->attach(Role::ID__CUSTOMER);
return in the logs
where could it find null there? Authorized user. The relation manytomany to roles is used everywhere, the role with the specified id exists. What can be checked? Call to a member function roles() on null
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question