original_string: public function update($id)
      {
          $user = $this->repository->getById($id);
  
          if (!$user) {
              return $this->errorNotFound();
          }
  
          $this->authorize('update', $user);
          $input = $this->validator
              ->bind('name', ['user_id' => $user->id])
              ->bind('email', ['user_id' => $user->id])
              ->validate('update');
          $user  = dispatch_now(new UpdateUser($user, $input));
          return new UserResource($user);
      }
code: public function update($id)
      {
          $user = $this->repository->getById($id);
  
          if (!$user) {
              return $this->errorNotFound();
          }
  
          $this->authorize('update', $user);
          $input = $this->validator
              ->bind('name', ['user_id' => $user->id])
              ->bind('email', ['user_id' => $user->id])
              ->validate('update');
          $user  = dispatch_now(new UpdateUser($user, $input));
          return new UserResource($user);
      }
code_tokens: public function update ( $ id ) { $ user = $ this -> repository -> getById ( $ id ) ; if ( ! $ user ) { return $ this -> errorNotFound ( ) ; } $ this -> authorize ( 'update' , $ user ) ; $ input = $ this -> validator -> bind ( 'name' , [ 'user_id' => $ user -> id ] ) -> bind ( 'email' , [ 'user_id' => $ user -> id ] ) -> validate ( 'update' ) ; $ user = dispatch_now ( new UpdateUser ( $ user , $ input ) ) ; return new UserResource ( $ user ) ; }
docstring: Updates the specified resource.
  
  @SWG\Patch(path="/users/{id}",
  tags={"user"},
  summary="Updated specific user",
  description="Updates specified user, <b>'admin-access'</b> policy is required.",
  produces={"application/json"},
  security={{"AdminAccess": {}}},
  @SWG\Parameter(
  name="id",
  in="path",
  description="ID of user that needs to be updated.",
  required=true,
  type="integer"
  ),
  @SWG\Parameter(
  in="body",
  name="body",
  description="Fields to update.",
  required=true,
  @SWG\Schema(
  type="object",
  required={"email, name"},
  @SWG\Property(property="email", type="string", example="john.doe@example.com"),
  @SWG\Property(property="name", type="string", example="JohnDoe"),
  @SWG\Property(property="first_name", type="string", example="John"),
  @SWG\Property(property="last_name", type="string", example="Doe")
  )
  ),
  @SWG\Response(
  response=200,
  description="Successful operation",
  @SWG\Schema(type="object", ref="#/definitions/User"),
  ),
  @SWG\Response(response=404, description="User not found"),
  @SWG\Response(
  response=422,
  description="Validation Error",
  @SWG\Schema(ref="#/definitions/ValidationErrors")
  )
  )
  
  @param int $id User id
  
  @throws \Illuminate\Validation\ValidationException
  @throws \Illuminate\Auth\Access\AuthorizationException
  
  @return UserResource
docstring_tokens: Updates the specified resource .