Laravel 5.1中带有和或的WHERE条款?

Laravel 5.1中带有和或的WHERE条款?,laravel,laravel-5,Laravel,Laravel 5,我试图使用Laravel 5.1中带或条件的Where条款, 以下是我的要求: ->WHERE (request_id=1) and (sender_id=11 or receiver_id=11) 如何在Laravel 5中使用上述条款 非常感谢您的帮助:) DB::table('yourTable') ->where('request_id', '=', '1') ->where(function($query) {

我试图使用Laravel 5.1中带或条件的Where条款, 以下是我的要求:

->WHERE (request_id=1) and (sender_id=11 or receiver_id=11)
如何在Laravel 5中使用上述条款

非常感谢您的帮助:)

DB::table('yourTable')
        ->where('request_id', '=', '1')
        ->where(function($query)
        {
            $query->where('sender_id', '=', 11)
                  ->orWhere('receiver_id', '=', '11');
        })
        ->get();