1if (request()->has('since')) { 2 // example.org/?since= 3 // fails with illegal operator and value combination 4 $query->whereDate('created_at', '<=', request('since')); 5} 6 7if (request()->input('name')) { 8 // example.org/?name=0 9 // fails to apply query filter because evaluates to false10 $query->where('name', request('name'));11}12 13if (request()->filled('key')) {14 // correct way to check if get parameter has value15}
Tip given by @mc0de