1018 0 0 0
Last Updated : 2025-11-03 15:14:33
this snippet will provide you code examples of how to use multiple where conditions with multiple or conditions or and conditions
If you need to use multiple AND do like this:
->where($condition)
->where($anotherCondition)If you want to use OR do this:
->where($condition)
->orWhere($anotherCondition)To combine multiple AND and OR do parameter grouping:
->where('name', '=', 'John')
->where(function ($query) {
$query->where('sender_id', 1)
->orWhere('receiver_id', 2);
})
->orWhere(function ($query) {
$query->where('numbers', '>', 100)
->where('title', '<>', 'Admin');
})