/**
  * Update the specified resource.
  *
  * @param Request $request
  * @param int     $id
  *
  * @return Response
  */
 public function update(PermissionAdminRequest $request, Permission $permission)
 {
     try {
         $attributes = $request->all();
         $permission->update($attributes);
         $this->responseCode = 204;
         $this->responseMessage = trans('messages.success.updated', ['Module' => 'Permission']);
         $this->responseRedirect = trans_url('/admin/user/permission/' . $permission->getRouteKey());
         return $this->respond($request);
     } catch (Exception $e) {
         $this->responseCode = 400;
         $this->responseMessage = $e->getMessage();
         $this->responseRedirect = trans_url('/admin/user/permission/' . $permission->getRouteKey());
         return $this->respond($request);
     }
 }
 /**
  * Update the permission.
  *
  * @param Request $request
  * @param int     $id
  *
  * @return Response
  */
 public function update(PermissionAdminWebRequest $request, Permission $permission)
 {
     try {
         $attributes = $request->all();
         $permission->update($attributes);
         return response()->json(['message' => trans('messages.success.updated', ['Module' => trans('user::permission.name')]), 'code' => 204, 'redirect' => trans_url('/admin/user/permission/' . $permission->getRouteKey())], 201);
     } catch (Exception $e) {
         return response()->json(['message' => $e->getMessage(), 'code' => 400, 'redirect' => trans_url('/admin/user/permission/' . $permission->getRouteKey())], 400);
     }
 }