src/Traits/WorksWithRelations.php
protected function handleRelations(array $fillable, Model $model, Relation $relation)
    {
        switch (true) {
        case $relation instanceof HasOne || $relation instanceof MorphOne:
            $this->updateOrCreateHasOne($fillable, $model, $relation);
            break;
        case $relation instanceof BelongsTo:
            $this->updateOrCreateBelongsToOne($fillable, $model, $relation);
            break;
        case $relation instanceof HasMany || $relation instanceof MorphMany:
            $this->updateOrCreateHasMany($fillable, $model, $relation);
            break;
        case $relation instanceof BelongsToMany || $relation instanceof MorphToMany:
            $this->updateOrCreateBelongsToMany($fillable, $model, $relation);
            break;
        }
    }
protected function handleRelations(array $fillable, Model $model, Relation $relation)
    {
        switch (true) {
        case $relation instanceof HasOne || $relation instanceof MorphOne:
            $this->updateOrCreateHasOne($fillable, $model, $relation);
            break;
        case $relation instanceof BelongsTo:
            $this->updateOrCreateBelongsToOne($fillable, $model, $relation);
            break;
        case $relation instanceof HasMany || $relation instanceof MorphMany:
            $this->updateOrCreateHasMany($fillable, $model, $relation);
            break;
        case $relation instanceof BelongsToMany || $relation instanceof MorphToMany:
            $this->updateOrCreateBelongsToMany($fillable, $model, $relation);
            break;
        }
    }
protected function handleRelations ( array $ fillable , Model $ model , Relation $ relation ) { switch ( true ) { case $ relation instanceof HasOne || $ relation instanceof MorphOne : $ this -> updateOrCreateHasOne ( $ fillable , $ model , $ relation ) ; break ; case $ relation instanceof BelongsTo : $ this -> updateOrCreateBelongsToOne ( $ fillable , $ model , $ relation ) ; break ; case $ relation instanceof HasMany || $ relation instanceof MorphMany : $ this -> updateOrCreateHasMany ( $ fillable , $ model , $ relation ) ; break ; case $ relation instanceof BelongsToMany || $ relation instanceof MorphToMany : $ this -> updateOrCreateBelongsToMany ( $ fillable , $ model , $ relation ) ; break ; } }
Handle relations.

@param array    $fillable The relation fillable.
@param Model    $model    The eloquent model.
@param Relation $relation The eloquent relation.

@return void
Handle relations .