Hey guys I am facing some problem I am using laravel 5.2 and I want to run a query like this:
SELECT * FROM Chat
WHERE (From='1234' AND Number='420') OR WHERE (From='420' AND Number='1234');
For that I am trying this but not getting the exact result:
$products = Chat::where('from', '=', $from)->where('number', '=', $number)->orwhere('from', '=', $number)->orwhere('number', '=', $from)->orderBy('id', 'ASC')->paginate(10);
How can I make it work there is no such document where I can generate a query like that.