public function newFromBuilderRecursive(Model $model, array $attributes = [], Relation $parentRelation = null)
    {
        $instance = $model->newInstance([], $exists = true);

        // fill the instance attributes with checking
        $instance->unguard();
        $instance->fill($attributes);
        $instance->reguard();
        // Load relations recursive
        $this->loadRelationsAttributesRecursive($instance);

        // Load pivot
        $this->loadPivotAttribute($instance, $parentRelation);

        return $instance;
    }
public function newFromBuilderRecursive(Model $model, array $attributes = [], Relation $parentRelation = null)
    {
        $instance = $model->newInstance([], $exists = true);

        // fill the instance attributes with checking
        $instance->unguard();
        $instance->fill($attributes);
        $instance->reguard();
        // Load relations recursive
        $this->loadRelationsAttributesRecursive($instance);

        // Load pivot
        $this->loadPivotAttribute($instance, $parentRelation);

        return $instance;
    }
public function newFromBuilderRecursive ( Model $ model , array $ attributes = [ ] , Relation $ parentRelation = null ) { $ instance = $ model -> newInstance ( [ ] , $ exists = true ) ; // fill the instance attributes with checking $ instance -> unguard ( ) ; $ instance -> fill ( $ attributes ) ; $ instance -> reguard ( ) ; // Load relations recursive $ this -> loadRelationsAttributesRecursive ( $ instance ) ; // Load pivot $ this -> loadPivotAttribute ( $ instance , $ parentRelation ) ; return $ instance ; }
Fill a model with form an elastic hit.

@param Model    $model
@param array    $attributes
@param Relation $parentRelation

@return mixed
Fill a model with form an elastic hit .