src/Filterable.php
public function scopeFilter($query, array $input = [], $filter = null)
    {
        // Resolve the current Model's filter
        if ($filter === null) {
            $filter = $this->getModelFilterClass();
        }

        // Create the model filter instance
        $modelFilter = new $filter($query, $input);

        // Set the input that was used in the filter (this will exclude empty strings)
        $this->filtered = $modelFilter->input();

        // Return the filter query
        return $modelFilter->handle();
    }
public function scopeFilter($query, array $input = [], $filter = null)
    {
        // Resolve the current Model's filter
        if ($filter === null) {
            $filter = $this->getModelFilterClass();
        }

        // Create the model filter instance
        $modelFilter = new $filter($query, $input);

        // Set the input that was used in the filter (this will exclude empty strings)
        $this->filtered = $modelFilter->input();

        // Return the filter query
        return $modelFilter->handle();
    }
public function scopeFilter ( $ query , array $ input = [ ] , $ filter = null ) { // Resolve the current Model's filter if ( $ filter === null ) { $ filter = $ this -> getModelFilterClass ( ) ; } // Create the model filter instance $ modelFilter = new $ filter ( $ query , $ input ) ; // Set the input that was used in the filter (this will exclude empty strings) $ this -> filtered = $ modelFilter -> input ( ) ; // Return the filter query return $ modelFilter -> handle ( ) ; }
Creates local scope to run the filter.

@param $query
@param array $input
@param null|string|ModelFilter $filter
@return \Illuminate\Database\Eloquent\Builder
Creates local scope to run the filter .