protected function getRelationMethods(array $relations, array $fields)
    {
        $methods = [];

        foreach ($fields as $field) {
            if ($field->hasForeignRelation()) {
                $relation = $field->getForeignRelation();
                $methods[$relation->name] = $this->getRelationshipMethod($relation);
            }
        }

        foreach ($relations as $relation) {
            $methods[$relation->name] = $this->getRelationshipMethod($relation);
        }

        return $methods;
    }
protected function getRelationMethods(array $relations, array $fields)
    {
        $methods = [];

        foreach ($fields as $field) {
            if ($field->hasForeignRelation()) {
                $relation = $field->getForeignRelation();
                $methods[$relation->name] = $this->getRelationshipMethod($relation);
            }
        }

        foreach ($relations as $relation) {
            $methods[$relation->name] = $this->getRelationshipMethod($relation);
        }

        return $methods;
    }
protected function getRelationMethods ( array $ relations , array $ fields ) { $ methods = [ ] ; foreach ( $ fields as $ field ) { if ( $ field -> hasForeignRelation ( ) ) { $ relation = $ field -> getForeignRelation ( ) ; $ methods [ $ relation -> name ] = $ this -> getRelationshipMethod ( $ relation ) ; } } foreach ( $ relations as $ relation ) { $ methods [ $ relation -> name ] = $ this -> getRelationshipMethod ( $ relation ) ; } return $ methods ; }
Gets the relations methods.

@param  array $relationships
@param  array $fields

@return array
Gets the relations methods .