public function scopeFilter($query)
    {
        if (!$this->filters) {

            $message = 'Please set the $filters property.';
            throw new FilterableSortableException($message);
        }

        $this->filters = app()->make($this->filters);

        if (!$this->filters instanceof QueryFilters) {

            $message = '$filters property must be a class instance of QueryFilter.';
            throw new FilterableSortableException($message);
        }

        return $this->filters->apply($query);
    }
public function scopeFilter($query)
    {
        if (!$this->filters) {

            $message = 'Please set the $filters property.';
            throw new FilterableSortableException($message);
        }

        $this->filters = app()->make($this->filters);

        if (!$this->filters instanceof QueryFilters) {

            $message = '$filters property must be a class instance of QueryFilter.';
            throw new FilterableSortableException($message);
        }

        return $this->filters->apply($query);
    }
public function scopeFilter ( $ query ) { if ( ! $ this -> filters ) { $ message = 'Please set the $filters property.' ; throw new FilterableSortableException ( $ message ) ; } $ this -> filters = app ( ) -> make ( $ this -> filters ) ; if ( ! $ this -> filters instanceof QueryFilters ) { $ message = '$filters property must be a class instance of QueryFilter.' ; throw new FilterableSortableException ( $ message ) ; } return $ this -> filters -> apply ( $ query ) ; }
Filter a result set.

@param Bulder $query The builder instance.

@return Builder

@throws FilterableSortableException
Filter a result set .