Laravel 4 Eloquent returns wrong ID
问题 I have 3 tables in my database: Campaigns Users Companies One company may have some users. One user may have some campaigns. A user (with admin rights) can do some actions with any campaign that belongs to his company. So, I want to check whether he's doing these actions with his campaign or not (in the last case I return something like "access denied"). My condition Campaign::join('users', 'users.id', '=', 'campaigns.user_id') ->where('users.company_id', '=', Auth::user()->company->id) -