FEATURE: make widget areas not deletable
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user