request->only([ 'menu_name', 'menu_url' => '', 'menu_route' => '', 'menu_type' => AdminMenuModel::$type_1, 'menu_img' => '', 'pid' => 0, 'private' => '', 'weight' => '', ], 'post'); $val = Validate::rule(Config::get('validate_rules.menuAdd')); if (!$val->check($param)) throw new ValidateException($val->getError()); return MenuLogic::add($param); } //编辑菜单 public function edit() { $param = $this->request->only([ 'id', 'menu_name', 'menu_url' => '', 'menu_route' => '', 'menu_type' => '', 'menu_img' => '', 'pid' => 0, 'private' => '', 'weight' => '', ], 'post'); $val = Validate::rule(Config::get('validate_rules.menuEdit')); if (!$val->check($param)) throw new ValidateException($val->getError()); return MenuLogic::edit($param); } //删除菜单 public function delete() { $id = $this->request->post('id/d', 0); return MenuLogic::delete($id); } //启禁用菜单 public function status() { $param = $this->request->only(['id', 'status'], 'post'); $val = Validate::rule(Config::get('validate_rules.status')); if (!$val->check($param)) throw new ValidateException($val->getError()); return MenuLogic::status($param); } }