I need to convert this query into laravel query builder
select * from employee where(( age = 25 and salary = 20000) or (age =30 and salary = 30000))
If you want to group where clauses you can nest them inside closures:
DB::table('employee')
->where(function ($query) {
$query->where('age', 25)->where('salary', 20000);
})
->orWHere(function ($query) {
$query->where('age', 30)->where('salary', 30000);
})
->get();
For more information have a look at Parameter Grouping in the documentation.