classes/Input/NestedModels.php
protected function storeChild($relation, $input, $prefix)
    {
        $child = $relation->getRelated()->newInstance();
        $child->fill($input);
        $rules = $this->getRules($relation, $input);
        (new ModelValidator)->validateAndPrefixErrors($prefix, $child, $rules);
        $relation->save($child);
    }
protected function storeChild($relation, $input, $prefix)
    {
        $child = $relation->getRelated()->newInstance();
        $child->fill($input);
        $rules = $this->getRules($relation, $input);
        (new ModelValidator)->validateAndPrefixErrors($prefix, $child, $rules);
        $relation->save($child);
    }
protected function storeChild ( $ relation , $ input , $ prefix ) { $ child = $ relation -> getRelated ( ) -> newInstance ( ) ; $ child -> fill ( $ input ) ; $ rules = $ this -> getRules ( $ relation , $ input ) ; ( new ModelValidator ) -> validateAndPrefixErrors ( $ prefix , $ child , $ rules ) ; $ relation -> save ( $ child ) ; }
Create a new child record

@param  Relation $relation
@param  array    $input    The data for the nested model
@param  string   $prefix   The input name prefix, for validation
@return void
Create a new child record