i am trying to use Where clause in Laravel 5.1 with or And or conditions, here is my requirement:
->WHERE (request_id=1) and (sender_id=11 or receiver_id=11)
how to use the above clause in Laravel 5.
Your help would be really appreciated :)
i am trying to use Where clause in Laravel 5.1 with or And or conditions, here is my requirement:
->WHERE (request_id=1) and (sender_id=11 or receiver_id=11)
how to use the above clause in Laravel 5.
Your help would be really appreciated :)
DB::table('yourTable')
->where('request_id', '=', '1')
->where(function($query)
{
$query->where('sender_id', '=', 11)
->orWhere('receiver_id', '=', '11');
})
->get();