FEATURE: make widget areas not deletable

This commit is contained in:
Michal Kváček
2016-09-20 14:16:33 +02:00
parent 5cbe19064b
commit 694724945d
6 changed files with 127 additions and 10 deletions
@@ -3,7 +3,6 @@
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use App\Http\Requests;
use App\Http\Requests\EditWidgetAreaRequest;
use App\Models\WidgetArea;
use Illuminate\Database\Eloquent\ModelNotFoundException;
@@ -61,6 +60,13 @@ class EditWidgetArea extends Controller
return $this->invalidArea();
}
// check if widget area is deletable
if (!$area->deletable) {
return redirect()
->back()
->with('error', trans('admin/widgetAreas.notDeletableArea'));
}
// delete area
$area->delete();