Assume that i have variables like $var1 and $var2.
Assume that i want to have a query like
$myQuery = DB::table('myTable')
->where('firstField', '=', $var1)
->where('secondField', '=', $var2)
->get();
Of course this one doesn't work when my variables are null. I want to control them, and do something if they are null.
I should create a query based on those variables and filter them with the values they hold.
Any other ideas how to do this ?