public function getEmptyValueForRelationship(string $relation)
    {
        if ($this->isSingleRelationship($relation)) {
            return;
        }

        if ($this->isManyRelationship($relation)) {
            return new Collection();
        }

        throw new MappingException("Cannot determine default value of $relation");
    }
public function getEmptyValueForRelationship(string $relation)
    {
        if ($this->isSingleRelationship($relation)) {
            return;
        }

        if ($this->isManyRelationship($relation)) {
            return new Collection();
        }

        throw new MappingException("Cannot determine default value of $relation");
    }
public function getEmptyValueForRelationship ( string $ relation ) { if ( $ this -> isSingleRelationship ( $ relation ) ) { return ; } if ( $ this -> isManyRelationship ( $ relation ) ) { return new Collection ( ) ; } throw new MappingException ( "Cannot determine default value of $relation" ) ; }
Return empty value for a given relationship.

@param string $relation

@throws MappingException

@return mixed
Return empty value for a given relationship .