示例#1
0
 /**
  * Update the specified resource.
  *
  * @param Request $request
  * @param int     $id
  *
  * @return Response
  */
 public function update(MenuRequest $request, $id)
 {
     try {
         $menu = $this->repository->update($request->all(), $id);
         $this->responseCode = 204;
         $this->responseMessage = trans('messages.success.updated', ['Module' => trans('menu::menu.name')]);
         $this->responseRedirect = trans_url('/admin/menu/submenu/' . $menu->getRouteKey());
         return $this->respond($request);
     } catch (Exception $e) {
         $this->responseCode = 400;
         $this->responseMessage = $e->getMessage();
         $this->responseRedirect = trans_url('/admin/menu/submenu/' . $menu->getRouteKey());
         return $this->respond($request);
     }
 }
示例#2
0
 public function tree(MenuRequest $request, $id)
 {
     $this->repository->updateTree($id, $request->get('tree'));
 }