/**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     if ($id == 1) {
         return redirect()->route('admin.setting_type.index')->with('fail', 'ID为1的默认动态设置分组不能被删除!!');
     } else {
         if ($this->setting->hasSetting($id)) {
             return redirect()->route('admin.setting_type.index')->with('fail', '该分组下还存在设置项,不能被删除;请清空该分组下设置项后再试!!');
         } else {
             $this->setting->destroy($id, '');
             //注意,第二个参数不为'setting',取的是SettingType模型
             return redirect()->route('admin.setting_type.index')->with('message', '删除动态设置分组成功!');
         }
     }
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     //
     $this->setting->destroy($id, 'setting');
     return redirect()->route('admin.setting.index')->with('message', '删除动态设置成功!');
 }