Skip to content
Advertisement

Tag: laravel-relations

I am fetching data of user where role equals to teacher , status is active and other orWhere. This collection gives me super admin user also but why?

I am working on search. I am facing issue with the query. when ever i search super. It gives me super admin user also but i am using ->whereRelation(‘role’,’name’, ‘teacher’) Answer that because if any orWhere come with true, the record will be fetched, you should group your orWhere in one statment:

Advertisement