FEATURE: make widgets not deletable

This commit is contained in:
Michal Kváček
2016-09-20 14:24:40 +02:00
parent 694724945d
commit a0f3409f82
5 changed files with 47 additions and 4 deletions
@@ -79,6 +79,13 @@ class EditWidget extends Controller
// create new widget
$widget = Widget::findOrFail($id);
// check if widget area is deletable
if (!$widget->deletable) {
return redirect()
->back()
->with('error', trans('admin/widgets.notDeletable'));
}
$widget->delete();
// redirect with success notification