| @@ 152-169 (lines=18) @@ | ||
| 149 | ->with('route', $this->route); |
|
| 150 | } |
|
| 151 | ||
| 152 | public function show($id) |
|
| 153 | { |
|
| 154 | if (!$this->entityInstance) { |
|
| 155 | $this->entityInstance = $this->entity->findOrFail($id); |
|
| 156 | } |
|
| 157 | ||
| 158 | $this->prepareFields(); |
|
| 159 | ||
| 160 | return view('crud::show') |
|
| 161 | ->with('type', 'show') |
|
| 162 | ->with('route', $this->route) |
|
| 163 | ->with('t', $this->texts) |
|
| 164 | ->with('formColsClasses', $this->formColsClasses) |
|
| 165 | ->with('colsNumber', $this->formCols['show']) |
|
| 166 | ->with('fieldsGroup', collect($this->fields)->split($this->formCols['show'])) |
|
| 167 | ->with('fields', $this->fields) |
|
| 168 | ->with('data', $this->entityInstance); |
|
| 169 | } |
|
| 170 | ||
| 171 | public function create() |
|
| 172 | { |
|
| @@ 237-255 (lines=19) @@ | ||
| 234 | : trans('eliurkis::crud.save_action')); |
|
| 235 | } |
|
| 236 | ||
| 237 | public function edit($id) |
|
| 238 | { |
|
| 239 | if (!$this->entityInstance) { |
|
| 240 | $this->entityInstance = $this->entity->findOrFail($id); |
|
| 241 | } |
|
| 242 | ||
| 243 | $this->prepareFields(); |
|
| 244 | ||
| 245 | return view('crud::create') |
|
| 246 | ->with('type', 'edit') |
|
| 247 | ->with('route', $this->route) |
|
| 248 | ->with('t', $this->texts) |
|
| 249 | ->with('formColsClasses', $this->formColsClasses) |
|
| 250 | ->with('links', $this->prepareLinks()) |
|
| 251 | ->with('colsNumber', $this->formCols['edit']) |
|
| 252 | ->with('fieldsGroup', collect($this->fields)->split($this->formCols['edit'])) |
|
| 253 | ->with('fields', $this->fields) |
|
| 254 | ->with('data', $this->entityInstance); |
|
| 255 | } |
|
| 256 | ||
| 257 | public function update(Request $request, $id) |
|
| 258 | { |
|