$file = $request->file('image');
$avatar = Image::make($file);
$avatar->resize(280, 280, function ($constraint) {
$constraint->aspectRatio();
})->encode(null, $avatar->filesize() > 200000 ? 80 : null);
$filename = $file->getClientOriginalName();
$mime = $file->getClientOriginalExtension();
$filename = md5(time() . $filename) . '.' . $mime;
Storage::disk('s3')->put($path . $filename, $avatar);