Skip to content
Advertisement

Multiple where conditions with ‘AND’ & ‘OR’ operators in laravel

in my laravel controller i’m trying to perform the following query for the user search.

JavaScript

What I really want to perform is,

JavaScript

But the above laravel query outputs all the users without considering the `role_id=3

Advertisement

Answer

You can use where callback

JavaScript

also you can change

JavaScript

to

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement