public function filter($request = [], $limit = null)
	{
		return $this->getModel()
			->with('category')
			->actives() //it needs to go into the query object as well
			->filter($request)
			->orderBy('rate_val', 'desc');
	}
public function filter($request = [], $limit = null)
	{
		return $this->getModel()
			->with('category')
			->actives() //it needs to go into the query object as well
			->filter($request)
			->orderBy('rate_val', 'desc');
	}
public function filter ( $ request = [ ] , $ limit = null ) { return $ this -> getModel ( ) -> with ( 'category' ) -> actives ( ) //it needs to go into the query object as well -> filter ( $ request ) -> orderBy ( 'rate_val' , 'desc' ) ; }
Filters products by a given request.

@param array $request
@param integer $limit

@return \Illuminate\Database\Eloquent\Collection
Filters products by a given request .