feat: .jpg
This commit is contained in:
parent
f2f91934b5
commit
de8ce8941a
|
|
@ -20,7 +20,9 @@ public function register(RegisterRequest $request): JsonResponse
|
|||
$avatarUri = null;
|
||||
|
||||
if ($request->hasFile('avatar')) {
|
||||
$avatarUri = $request->file('avatar')->store('avatars', 'public');
|
||||
$filename = \Illuminate\Support\Str::uuid() . '.jpg';
|
||||
$path = $request->file('avatar')->storeAs('avatars', $filename, 'public');
|
||||
$avatarUri = url('storage/' . $path);
|
||||
}
|
||||
|
||||
$user = User::create([
|
||||
|
|
|
|||
|
|
@ -22,7 +22,8 @@ class UsersController extends Controller
|
|||
'avatar' => ['required', 'image', 'max:2048'], // 2MB max
|
||||
]);
|
||||
|
||||
$path = $request->file('avatar')->store('avatars', 'public');
|
||||
$filename = \Illuminate\Support\Str::uuid() . '.jpg';
|
||||
$path = $request->file('avatar')->storeAs('avatars', $filename, 'public');
|
||||
|
||||
$user->update([
|
||||
'avatarUri' => url('storage/' . $path),
|
||||
|
|
|
|||
|
|
@ -62,6 +62,9 @@ services:
|
|||
sleep 5;
|
||||
done;
|
||||
echo '✅ Migrations applied.';
|
||||
echo '🔗 Creating storage symlink...';
|
||||
php artisan storage:link || true;
|
||||
echo '✅ Storage link done.';
|
||||
"
|
||||
|
||||
phpmyadmin:
|
||||
|
|
|
|||
Loading…
Reference in New Issue