protected function makeCopyOfRelations(\Illuminate\Http\Request $request)
    {
        $newData = [];
        $data = $request->input($this->relationName, []);

        $counter = 1;
        $newKey = static::NEW_ITEM;

        foreach ($data as $key => $values) {
            $newData["{$newKey}_{$counter}"] = $values;
            $counter++;
        }

        $request->merge([$this->relationName => $newData]);
    }
protected function makeCopyOfRelations(\Illuminate\Http\Request $request)
    {
        $newData = [];
        $data = $request->input($this->relationName, []);

        $counter = 1;
        $newKey = static::NEW_ITEM;

        foreach ($data as $key => $values) {
            $newData["{$newKey}_{$counter}"] = $values;
            $counter++;
        }

        $request->merge([$this->relationName => $newData]);
    }
protected function makeCopyOfRelations ( \ Illuminate \ Http \ Request $ request ) { $ newData = [ ] ; $ data = $ request -> input ( $ this -> relationName , [ ] ) ; $ counter = 1 ; $ newKey = static :: NEW_ITEM ; foreach ( $ data as $ key => $ values ) { $ newData [ "{$newKey}_{$counter}" ] = $ values ; $ counter ++ ; } $ request -> merge ( [ $ this -> relationName => $ newData ] ) ; }
Creates a copy of form relations.

@param \Illuminate\Http\Request $request
Creates a copy of form relations .