many to many working oneway only

Posted 2 years ago by arctushar
return Company::find(2)->users; 

working good but

return User::find(1)->companies;

giving error, what is the problem ?

I have Authentication through make:auth command

This is extension part of https://laracasts.com/discuss/channels/eloquent/many-to-many-not-working-for-a-query

Please sign in or create an account to participate in this conversation.