Wednesday, March 29, 2017

Manage relation using Eloquemt ORM

I am working with Laravel5.4. I have a user table that have column like id,introducer_id,company_id,user_role.

If login user has company_id as 1 than fetch all users who has company_id as 1 and also fetch whose company is not same as login user but user_role is 3.

I need to fetch users as per the above requirement using Eloquent ORM. So how can I write query?



via Nisarg Bhavsar

Advertisement