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

        $instance->setRawAttributes((array)$attributes, $sync = true);

        // Load relations recursive
        static::loadRelationsAttributesRecursive($instance);
        // Load pivot
        static::loadPivotAttribute($instance, $parentRelation);

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

        $instance->setRawAttributes((array)$attributes, $sync = true);

        // Load relations recursive
        static::loadRelationsAttributesRecursive($instance);
        // Load pivot
        static::loadPivotAttribute($instance, $parentRelation);

        return $instance;
    }
public static function newFromBuilderRecursive ( Model $ model , array $ attributes = [ ] , Relation $ parentRelation = null ) { $ instance = $ model -> newInstance ( [ ] , $ exists = true ) ; $ instance -> setRawAttributes ( ( array ) $ attributes , $ sync = true ) ; // Load relations recursive static :: loadRelationsAttributesRecursive ( $ instance ) ; // Load pivot static :: loadPivotAttribute ( $ instance , $ parentRelation ) ; return $ instance ; }
Create a new model instance that is existing recursive.

@param  \Illuminate\Database\Eloquent\Model  $model
@param  array  $attributes
@param  \Illuminate\Database\Eloquent\Relations\Relation  $parentRelation
@return static
Create a new model instance that is existing recursive .