src/Traits/Module/HasFilters.php
protected function fetchModelScopes($model)
    {
        $reflection = new \ReflectionClass($model);

        foreach ($reflection->getMethods() as $method) {
            if (preg_match('~^scope(.+)$~i', $method->name, $match)) {
                if ($this->isHiddenScope($name = $match[1])
                    || $this->isDynamicScope($method)
                    || $this->hasHiddenFlag($method->getDocComment())
                    || 'scopeTranslated' === $match[0]) {
                    continue;
                }

                $scope = with(new Scope($name))->setQuery([$model, $name]);
                if ($icon = $this->hasIconFlag($method->getDocComment())) {
                    $scope->setIcon($icon);
                }

                $this->addScope($scope);
            }
        }
    }
protected function fetchModelScopes($model)
    {
        $reflection = new \ReflectionClass($model);

        foreach ($reflection->getMethods() as $method) {
            if (preg_match('~^scope(.+)$~i', $method->name, $match)) {
                if ($this->isHiddenScope($name = $match[1])
                    || $this->isDynamicScope($method)
                    || $this->hasHiddenFlag($method->getDocComment())
                    || 'scopeTranslated' === $match[0]) {
                    continue;
                }

                $scope = with(new Scope($name))->setQuery([$model, $name]);
                if ($icon = $this->hasIconFlag($method->getDocComment())) {
                    $scope->setIcon($icon);
                }

                $this->addScope($scope);
            }
        }
    }
protected function fetchModelScopes ( $ model ) { $ reflection = new \ ReflectionClass ( $ model ) ; foreach ( $ reflection -> getMethods ( ) as $ method ) { if ( preg_match ( '~^scope(.+)$~i' , $ method -> name , $ match ) ) { if ( $ this -> isHiddenScope ( $ name = $ match [ 1 ] ) || $ this -> isDynamicScope ( $ method ) || $ this -> hasHiddenFlag ( $ method -> getDocComment ( ) ) || 'scopeTranslated' === $ match [ 0 ] ) { continue ; } $ scope = with ( new Scope ( $ name ) ) -> setQuery ( [ $ model , $ name ] ) ; if ( $ icon = $ this -> hasIconFlag ( $ method -> getDocComment ( ) ) ) { $ scope -> setIcon ( $ icon ) ; } $ this -> addScope ( $ scope ) ; } } }
Parse the model for scopes.

@param $model
Parse the model for scopes .