예제 #1
0
 /**
  * Resize the avatar to the cropper area.
  *
  * @param Request $request
  * @return array
  *
  * @author Cali
  */
 public function resizeAvatar(Request $request)
 {
     $resized_avatar = Avatar::resize($request);
     return $this->successResponse(['avatarUrl' => route('users.avatar', ['user' => $request->user()->id, 'v' => $request->user()->avatarVersion() + 1]), 'message' => $resized_avatar ? trans('views.admin.pages.users.profile.avatar.update-success') : trans('views.admin.pages.users.profile.avatar.update-failure')]);
 }