protected function normalizeRelation(Relation $relation)
    {
        if ($this->isInstanceOf($relation, [BelongsTo::class, HasOne::class, MorphOne::class, MorphTo::class])) {
            return $relation->first();
        }

        return $relation->get();
    }
protected function normalizeRelation(Relation $relation)
    {
        if ($this->isInstanceOf($relation, [BelongsTo::class, HasOne::class, MorphOne::class, MorphTo::class])) {
            return $relation->first();
        }

        return $relation->get();
    }
protected function normalizeRelation ( Relation $ relation ) { if ( $ this -> isInstanceOf ( $ relation , [ BelongsTo :: class , HasOne :: class , MorphOne :: class , MorphTo :: class ] ) ) { return $ relation -> first ( ) ; } return $ relation -> get ( ) ; }
Normalize a relationship.

@param  \Illuminate\Database\Eloquent\Relations\Relation $relation
@return \Illuminate\Support\Collection|\Illuminate\Database\Eloquent\Model|null
Normalize a relationship .