Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Laravel 4 eloquent WHERE with OR AND OR?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 117
    Comment on it

    In Laravel 4.x we can easily use where condition with OR AND OR .Below is the example of this

    Example:

    1. User::where(function ($query) {
    2. $query->where('a', '=', 1)
    3. ->orWhere('b', '=', 1);
    4. })->where(function ($query) {
    5. $query->where('c', '=', 1)
    6. ->orWhere('d', '=', 1);
    7. });

    Here In the above example you can see that User is a model where with OR AND OR.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Reset Password
Fill out the form below and reset your password: