public static function bootAppliesScopes()
    {
        if (SurveyorProvider::isActive()) {
            $repository = SurveyorProvider::retrieve();
            foreach ($repository['scopes'] as $model => $scopes) {
                foreach ($scopes as $scope) {
                    if (get_called_class() == $model) {
                        static::addGlobalScope(new $scope());
                    }
                }
            }
        } else {
            if (Auth::user() != null) {
                // Surveyor needs to be active. Throw exception.
                throw RepositoryException::notInitialized();
            }
        }
    }