public function updateAvatar() { return $this->wrapCommonExceptions(function () { $imageStoreCommand = UserUpdateAvatarCommand::hydrateFromInput(); $imageId = $this->adapter->dispatchCommand($imageStoreCommand); $updateAvatarCommand = new UserUpdateAvatarCommand($imageId); $this->adapter->dispatchCommand($updateAvatarCommand); return $this->respondSuccess(['entity_id' => $imageId], 201); }); }