There might be some times when you have 10+ scopes in your model which can make your model cluttered ! Well today i have that solution for you along with a bonus tip ! Imagine we have a model like this: where('quantity','!=', 0); } public function scopeSortFilterBy($query,$sortBy = "") { switch ($sortBy) { case 'featured': return $query->where('featured','=', -1); break; case 'low': return $query->orderBy('sale_price', 'asc'); break; case 'heigh': return $query->orderBy('sale_price', 'desc'); break; default: return $query; break; } } public function scopeFilterAttributes($query,$checkboxValues) { if($checkboxValues !== NULL){ return $query->whereHas('attributeValues', function ($query) use($checkboxValues){ $query->whereIn('value',$checkboxValues); }); } return $query; } public function scopeSearchProducts($query,$search = "") { if($search !== NULL){ $searchTerm = '%'.