问题 I am trying to create ( (Where and Where) OR (Where and Where) ) And after a lot of searching I found this $sender = \App\User::where('username','=',$username)->firstOrFail(); $receiver = Auth::user(); $messages = \App\Message::Where(function($query) { $query->where("sender",$sender->id) ->where("receiver",$receiver->id); }) ->orWhere(function($query) { $query->Where("sender",$receiver->id) ->Where("receiver",$sender->id); }) ->get(); But it's showing me that the $sender and the $receiver