@@ 116-125 (lines=10) @@ | ||
113 | * |
|
114 | * @return \Illuminate\Http\RedirectResponse |
|
115 | */ |
|
116 | public function postCreate(ModelCreateRequest $request) |
|
117 | { |
|
118 | if (!$this->modelAdmin->hasCreating()) { |
|
119 | return $this->missingMethod(); |
|
120 | } |
|
121 | ||
122 | $this->modelAdmin->create(); |
|
123 | ||
124 | return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The '.$this->modelAdmin->getTitle().' was successfully created.', 'dismissable' => false]]); |
|
125 | } |
|
126 | ||
127 | /** |
|
128 | * View a Model Entry from ModelAdmin View Page. |
|
@@ 170-179 (lines=10) @@ | ||
167 | * |
|
168 | * @return \Illuminate\Http\RedirectResponse |
|
169 | */ |
|
170 | public function postEdit(ModelEditRequest $request, $modelitemId) |
|
171 | { |
|
172 | if (!$this->modelAdmin->hasEditing()) { |
|
173 | return $this->missingMethod(); |
|
174 | } |
|
175 | ||
176 | $this->modelAdmin->edit($modelitemId); |
|
177 | ||
178 | return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The '.$this->modelAdmin->getTitle().' was successfully updated.', 'dismissable' => false]]); |
|
179 | } |
|
180 | ||
181 | /** |
|
182 | * Delete Model Entry from ModelAdmin Delete Page. |
|
@@ 210-219 (lines=10) @@ | ||
207 | * |
|
208 | * @return \Illuminate\Http\RedirectResponse |
|
209 | */ |
|
210 | public function postDelete($modelitemId) |
|
211 | { |
|
212 | if (!$this->modelAdmin->hasDeleting()) { |
|
213 | return $this->missingMethod(); |
|
214 | } |
|
215 | ||
216 | $this->modelAdmin->delete($modelitemId); |
|
217 | ||
218 | return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The '.$this->modelAdmin->getTitle().' was successfully removed.', 'dismissable' => false]]); |
|
219 | } |
|
220 | ||
221 | /** |
|
222 | * Restore a ModelItem. |
|
@@ 244-253 (lines=10) @@ | ||
241 | * |
|
242 | * @return \Illuminate\Http\RedirectResponse |
|
243 | */ |
|
244 | public function postRestore($modelitemId) |
|
245 | { |
|
246 | if (!$this->modelAdmin->hasSoftDeleting()) { |
|
247 | return $this->missingMethod(); |
|
248 | } |
|
249 | ||
250 | $this->modelAdmin->restore($modelitemId); |
|
251 | ||
252 | return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The '.$this->modelAdmin->getTitle().' was successfully restored.', 'dismissable' => false]]); |
|
253 | } |
|
254 | ||
255 | /** |
|
256 | * Clone a Page. |
|
@@ 262-271 (lines=10) @@ | ||
259 | * |
|
260 | * @return \Illuminate\Http\Response |
|
261 | */ |
|
262 | public function getClone($modelitemId) |
|
263 | { |
|
264 | if (!$this->modelAdmin->hasCloning()) { |
|
265 | return $this->missingMethod(); |
|
266 | } |
|
267 | ||
268 | $this->modelAdmin->clone($modelitemId); |
|
269 | ||
270 | return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The '.$this->modelAdmin->getTitle().' was successfully cloned.', 'dismissable' => false]]); |
|
271 | } |
|
272 | } |
|
273 |