public function getDestroy($id) { if (Session::get('user_level') < Config::get('cms.deleteCategory')) { return Redirect::to(_l(URL::action('AdminHomeController@getIndex')))->with('message', Lang::get('admin.notPermitted'))->with('notif', 'warning'); } try { $category = Category::onlyTrashed()->findOrFail($id); $category->newsCategories()->forceDelete(); $category->forceDelete(); return Redirect::to(_l(URL::action('CategoryController@getTrashed')))->with('message', Lang::get('admin.categoryDeleted'))->with('notif', 'success'); } catch (Exception $e) { return Redirect::to(_l(URL::action('CategoryController@getTrashed')))->with('message', Lang::get('admin.noSuchCategory'))->with('notif', 'danger'); } }