protected function prepareRequestToBeCopied(Request $request)
    {
        $remove = [];
        if ($request->method() === 'POST' && $request->input('next_action') === 'save_and_create') {
            if (! $this->copyAfterSave) {
                $remove[] = $this->relationName;
            }
            $this->makeCopyOfRelations($request);
        }

        return $request->replace($request->except($remove));
    }
protected function prepareRequestToBeCopied(Request $request)
    {
        $remove = [];
        if ($request->method() === 'POST' && $request->input('next_action') === 'save_and_create') {
            if (! $this->copyAfterSave) {
                $remove[] = $this->relationName;
            }
            $this->makeCopyOfRelations($request);
        }

        return $request->replace($request->except($remove));
    }
protected function prepareRequestToBeCopied ( Request $ request ) { $ remove = [ ] ; if ( $ request -> method ( ) === 'POST' && $ request -> input ( 'next_action' ) === 'save_and_create' ) { if ( ! $ this -> copyAfterSave ) { $ remove [ ] = $ this -> relationName ; } $ this -> makeCopyOfRelations ( $ request ) ; } return $ request -> replace ( $ request -> except ( $ remove ) ) ; }
Removes relation from request when it's in save_and_create mode.

@param \Illuminate\Http\Request $request

@return \Illuminate\Http\Request
Removes relation from request when it s in save_and_create mode .