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);
    }