feat: s3
This commit is contained in:
@@ -252,10 +252,10 @@ class AuthController extends Controller
|
||||
|
||||
if ($request->hasFile('avatar')) {
|
||||
if ($user->avatar_url) {
|
||||
Storage::disk('public')->delete($user->avatar_url);
|
||||
Storage::disk()->delete($user->avatar_url);
|
||||
}
|
||||
|
||||
$path = $request->file('avatar')->store('avatars', 'public');
|
||||
$path = $request->file('avatar')->store('avatars', );
|
||||
$data['avatar_url'] = $path;
|
||||
}
|
||||
|
||||
@@ -300,7 +300,7 @@ class AuthController extends Controller
|
||||
});
|
||||
|
||||
if (! empty($storagePaths)) {
|
||||
Storage::disk('public')->delete($storagePaths);
|
||||
Storage::disk()->delete($storagePaths);
|
||||
}
|
||||
|
||||
if ($request->hasSession()) {
|
||||
@@ -320,7 +320,7 @@ class AuthController extends Controller
|
||||
|
||||
$avatarPath = null;
|
||||
if ($request->hasFile('avatar')) {
|
||||
$avatarPath = $request->file('avatar')->store('avatars', 'public');
|
||||
$avatarPath = $request->file('avatar')->store('avatars');
|
||||
}
|
||||
|
||||
$userAttributes = $this->userAttributesFromRequestData($data);
|
||||
@@ -338,7 +338,7 @@ class AuthController extends Controller
|
||||
$user->forceDelete();
|
||||
|
||||
if ($avatarPath !== null) {
|
||||
Storage::disk('public')->delete($avatarPath);
|
||||
Storage::disk()->delete($avatarPath);
|
||||
}
|
||||
|
||||
return response()->json([
|
||||
|
||||
@@ -231,7 +231,7 @@ class MealPostController extends Controller
|
||||
$data = $request->validated();
|
||||
|
||||
if ($request->hasFile('image')) {
|
||||
$path = $request->file('image')->store('meal-posts', 'public');
|
||||
$path = $request->file('image')->store('meal-posts', );
|
||||
$data['image_url'] = $path;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user