Code Duplication    Length = 16-17 lines in 2 locations

src/CrudController.php 2 locations

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