How do I say WHERE (a=x AND b=y) OR (c=z AND d=j)
For x , y , z .. are variables .
How can i do that with eloquent ?
You can achieve this by passing a closure into the where() function of the query builder. This is covered in the advanced wheres section of the docs http://laravel.com/docs/5.0/queries#advanced-wheres
$results = MyModel::where(function($query) {
$query->where('a', 'x')
->where('b', 'y');
})->orWhere(function($query) {
$query->where('c', 'z')
->where('d', 'j');
})->get();