From fb7f9de127c13f9ffeaaec568e203b16dcddbd3b Mon Sep 17 00:00:00 2001 From: Chris Hunt Date: Sun, 18 Feb 2024 20:26:20 +0000 Subject: [PATCH] Fix upload paths --- app/Http/Controllers/ItemController.php | 2 +- app/Http/Controllers/SettingsController.php | 2 +- app/Http/Controllers/TagController.php | 4 ++-- app/Http/Controllers/UserController.php | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/ItemController.php b/app/Http/Controllers/ItemController.php index fa4c1ae34..050b2cb94 100644 --- a/app/Http/Controllers/ItemController.php +++ b/app/Http/Controllers/ItemController.php @@ -195,7 +195,7 @@ public static function storelogic(Request $request, $id = null): Item ]); if ($request->hasFile('file')) { - $path = $request->file('file')->store('icons'); + $path = $request->file('file')->store('icons', 'public'); $request->merge([ 'icon' => $path, ]); diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index 8f48055e7..3429cb6d1 100644 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -77,7 +77,7 @@ public function update(Request $request, int $id): RedirectResponse ); } - $path = $request->file('value')->store('backgrounds'); + $path = $request->file('value')->store('backgrounds', 'public'); if ($path === null) { throw new \Exception('file_not_stored'); diff --git a/app/Http/Controllers/TagController.php b/app/Http/Controllers/TagController.php index 6999689bc..79f7ad6ef 100644 --- a/app/Http/Controllers/TagController.php +++ b/app/Http/Controllers/TagController.php @@ -58,7 +58,7 @@ public function store(Request $request): RedirectResponse ]); if ($request->hasFile('file')) { - $path = $request->file('file')->store('icons'); + $path = $request->file('file')->store('icons', 'public'); $request->merge([ 'icon' => $path, ]); @@ -123,7 +123,7 @@ public function update(Request $request, int $id): RedirectResponse ]); if ($request->hasFile('file')) { - $path = $request->file('file')->store('icons'); + $path = $request->file('file')->store('icons', 'public'); $request->merge([ 'icon' => $path, ]); diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 2892366e2..6ac9249ad 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -68,7 +68,7 @@ public function store(Request $request): RedirectResponse } if ($request->hasFile('file')) { - $path = $request->file('file')->store('avatars'); + $path = $request->file('file')->store('avatars', 'public'); $user->avatar = $path; } @@ -128,7 +128,7 @@ public function update(Request $request, User $user): RedirectResponse } if ($request->hasFile('file')) { - $path = $request->file('file')->store('avatars'); + $path = $request->file('file')->store('avatars', 'public'); $user->avatar = $path; }