Code Duplication    Length = 16-17 lines in 2 locations

src/CrudController.php 2 locations

@@ 114-129 (lines=16) @@
111
            ->with('route', $this->route);
112
    }
113
114
    public function show($id)
115
    {
116
        if (!$this->entityInstance) {
117
            $this->entityInstance = $this->entity->findOrFail($id);
118
        }
119
120
        $this->prepareFields();
121
122
        return view('crud::show')
123
            ->with('type', 'show')
124
            ->with('route', $this->route)
125
            ->with('t', $this->texts)
126
            ->with('fields', $this->fields)
127
            ->with('formColsClasses', $this->formColsClasses)
128
            ->with('data', $this->entityInstance);
129
    }
130
131
    public function create()
132
    {
@@ 184-200 (lines=17) @@
181
                : trans('eliurkis::crud.save_action'));
182
    }
183
184
    public function edit($id)
185
    {
186
        if (!$this->entityInstance) {
187
            $this->entityInstance = $this->entity->findOrFail($id);
188
        }
189
190
        $this->prepareFields();
191
192
        return view('crud::create')
193
            ->with('type', 'edit')
194
            ->with('route', $this->route)
195
            ->with('t', $this->texts)
196
            ->with('fields', $this->fields)
197
            ->with('formColsClasses', $this->formColsClasses)
198
            ->with('links', $this->prepareLinks())
199
            ->with('data', $this->entityInstance);
200
    }
201
202
    public function update(Request $request, $id)
203
    {