$query = Product::query();
$query->when(request('filter_by') == 'price', function ($q) {
return $q->where('price', '>', request('filter_by'));
});
$query = Product::query();
$query->when(request('filter_by') == 'price', function ($q) {
return $q->where('price', '>', request('filter_by'));
});