Code Duplication    Length = 18-19 lines in 2 locations

src/CrudController.php 2 locations

@@ 130-147 (lines=18) @@
127
            ->with('route', $this->route);
128
    }
129
130
    public function show($id)
131
    {
132
        if (!$this->entityInstance) {
133
            $this->entityInstance = $this->entity->findOrFail($id);
134
        }
135
136
        $this->prepareFields();
137
138
        return view('crud::show')
139
            ->with('type', 'show')
140
            ->with('route', $this->route)
141
            ->with('t', $this->texts)
142
            ->with('formColsClasses', $this->formColsClasses)
143
            ->with('colsNumber', $this->formCols['show'])
144
            ->with('fieldsGroup', collect($this->fields)->split($this->formCols['show']))
145
            ->with('fields', $this->fields)
146
            ->with('data', $this->entityInstance);
147
    }
148
149
    public function create()
150
    {
@@ 214-232 (lines=19) @@
211
                : trans('eliurkis::crud.save_action'));
212
    }
213
214
    public function edit($id)
215
    {
216
        if (!$this->entityInstance) {
217
            $this->entityInstance = $this->entity->findOrFail($id);
218
        }
219
220
        $this->prepareFields();
221
222
        return view('crud::create')
223
            ->with('type', 'edit')
224
            ->with('route', $this->route)
225
            ->with('t', $this->texts)
226
            ->with('formColsClasses', $this->formColsClasses)
227
            ->with('links', $this->prepareLinks())
228
            ->with('colsNumber', $this->formCols['edit'])
229
            ->with('fieldsGroup', collect($this->fields)->split($this->formCols['edit']))
230
            ->with('fields', $this->fields)
231
            ->with('data', $this->entityInstance);
232
    }
233
234
    public function update(Request $request, $id)
235
    {