protected function isPotentialRelationMethod(ReflectionMethod $method)
    {
        if (
                ! $method->isPublic()
            // Check if we should ignore the method always
            ||  in_array($method->name, $this->getIgnoredRelationNames())
            // If the method has required parameters, we cannot call or use it
            ||  $method->getNumberOfRequiredParameters()
        ) {
            return false;
        }

        // Don't examine methods defined in certain namespaces
        foreach ($this->mustNotMatchClass as $regEx) {
            if (preg_match($regEx, $method->class)) {
                return false;
            }
        }

        // Don't examine methods defined in certain files
        $file = $method->getFileName();
        foreach ($this->mustNotMatchFile as $regEx) {
            if (preg_match($regEx, $file)) {
                return false;
            }
        }

        return true;
    }
protected function isPotentialRelationMethod(ReflectionMethod $method)
    {
        if (
                ! $method->isPublic()
            // Check if we should ignore the method always
            ||  in_array($method->name, $this->getIgnoredRelationNames())
            // If the method has required parameters, we cannot call or use it
            ||  $method->getNumberOfRequiredParameters()
        ) {
            return false;
        }

        // Don't examine methods defined in certain namespaces
        foreach ($this->mustNotMatchClass as $regEx) {
            if (preg_match($regEx, $method->class)) {
                return false;
            }
        }

        // Don't examine methods defined in certain files
        $file = $method->getFileName();
        foreach ($this->mustNotMatchFile as $regEx) {
            if (preg_match($regEx, $file)) {
                return false;
            }
        }

        return true;
    }
protected function isPotentialRelationMethod ( ReflectionMethod $ method ) { if ( ! $ method -> isPublic ( ) // Check if we should ignore the method always || in_array ( $ method -> name , $ this -> getIgnoredRelationNames ( ) ) // If the method has required parameters, we cannot call or use it || $ method -> getNumberOfRequiredParameters ( ) ) { return false ; } // Don't examine methods defined in certain namespaces foreach ( $ this -> mustNotMatchClass as $ regEx ) { if ( preg_match ( $ regEx , $ method -> class ) ) { return false ; } } // Don't examine methods defined in certain files $ file = $ method -> getFileName ( ) ; foreach ( $ this -> mustNotMatchFile as $ regEx ) { if ( preg_match ( $ regEx , $ file ) ) { return false ; } } return true ; }
Returns whether a reflected method may be an Eloquent relation.

@param ReflectionMethod $method
@return bool
Returns whether a reflected method may be an Eloquent relation .