protected function applyScopes($query)
    {
        foreach ($this->scopes as $scope) {
            $scope->apply($query);
        }

        return $query;
    }
protected function applyScopes($query)
    {
        foreach ($this->scopes as $scope) {
            $scope->apply($query);
        }

        return $query;
    }
protected function applyScopes ( $ query ) { foreach ( $ this -> scopes as $ scope ) { $ scope -> apply ( $ query ) ; } return $ query ; }
Apply query scopes.

@param \Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder $query
@return mixed
Apply query scopes .