How do I say WHERE (a=1 and b=1) or (c=1 and d=1)
For more complicated queries am I supposed to use raw SQL?
How do I say WHERE (a=1 and b=1) or (c=1 and d=1)
For more complicated queries am I supposed to use raw SQL?
Try this: http://laravel.com/docs/5.1/queries#advanced-where-clauses
DB::table('your_table')
->where(function($query)
{
$query->where('a', 1) ->where('b', 1);
})
->orWhere(function($query)
{
$query->where('c', 1)->where('d', 1);
})
->get();
@esmail please try to study then,wrote comment.You can definitely do this like that code
->where(function($query)
{
$query->where('a', 1)
->where('b', 1);
})