$request->validate([
'image' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048',
]);
$imageName = time() . '.' . $request->image->extension();
Store in Storage folder
$request->image->storeAs('images', $imageName);
// storage/app/images/file.png
Store in Public Folder
$request->image->move(public_path('images'), $imageName);
// public/images/file.png
Store in S3
$request->image->storeAs('images', $imageName, 's3');
// public/images/file.png
$dir_ktp = 'frontend/assets/img/foto_ktp/' . date('Y') . '/' . date('m');
$ext_ktp = $input['foto_ktp']->getClientOriginalExtension();
$ktp = $dir_ktp . '/' . Str::random(20) . '_' . date('d') . '_' . md5(time()) . '.' . $ext_ktp;
$input['foto_ktp']->move(public_path($dir_ktp), $ktp);