From f970d6eb0fe11c156c82986f2f942e200947d4d8 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Tue, 26 May 2026 15:14:14 +0530 Subject: [PATCH] Changed logic in create visitor entry --- .../Pages/CreateVisitorEntry.php | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/app/Filament/Resources/VisitorEntryResource/Pages/CreateVisitorEntry.php b/app/Filament/Resources/VisitorEntryResource/Pages/CreateVisitorEntry.php index 5dc94e5..d654bad 100644 --- a/app/Filament/Resources/VisitorEntryResource/Pages/CreateVisitorEntry.php +++ b/app/Filament/Resources/VisitorEntryResource/Pages/CreateVisitorEntry.php @@ -115,15 +115,25 @@ class CreateVisitorEntry extends CreateRecord $filename = 'visitor_' . time() . '_' . uniqid() . '.jpg'; - $path = 'visitor-photos/' . $filename; + $path = 'uploads/visitor-photos/' . $filename; - // Stores in storage/app/private/visitor-photos - Storage::put( - 'private/' . $path, + Storage::disk('local')->put( + $path, base64_decode($imageData) ); - $data['photo'] = 'private/' . $path; + $decoded = base64_decode($imageData); + + $saved = Storage::disk('local')->put($path, $decoded); + + \Log::info('PHOTO UPLOAD: file details', [ + 'filename' => $filename, + 'path' => $path, + 'size_bytes' => strlen($decoded), + 'saved' => $saved ? 'SUCCESS' : 'FAILED', + ]); + + $data['photo'] = $path; } return $data;