diff --git a/app/Http/Controllers/API/EventController.php b/app/Http/Controllers/API/EventController.php index 6ea8738..8dba7f7 100644 --- a/app/Http/Controllers/API/EventController.php +++ b/app/Http/Controllers/API/EventController.php @@ -70,7 +70,7 @@ public function store(Request $request) $storedPath = $image->storeAs('banners', $imageName, 'public'); // Check if the image was successfully uploaded - if (!Storage::disk('public')->exists($storedPath)) { + if ($storedPath && !Storage::disk('public')->exists($storedPath)) { return back()->withErrors(['image' => 'Failed to upload the image.'])->withInput(); } diff --git a/app/Http/Controllers/EventController.php b/app/Http/Controllers/EventController.php index f6795fe..1058b78 100644 --- a/app/Http/Controllers/EventController.php +++ b/app/Http/Controllers/EventController.php @@ -78,7 +78,7 @@ public function store(Request $request) $storedPath = $image->storeAs('banners', $imageName, 'public'); // Check if the image was successfully uploaded - if (!Storage::disk('public')->exists($storedPath)) { + if ($storedPath && !Storage::disk('public')->exists($storedPath)) { return back()->withErrors(['image' => 'Failed to upload the image.'])->withInput(); }