Changed logic in create visitor entry
Some checks failed
Gemini PR Review / Gemini PR Review (pull_request) Waiting to run
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Waiting to run
Laravel Larastan / larastan (pull_request) Waiting to run
Laravel Pint / pint (pull_request) Waiting to run
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Some checks failed
Gemini PR Review / Gemini PR Review (pull_request) Waiting to run
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Waiting to run
Laravel Larastan / larastan (pull_request) Waiting to run
Laravel Pint / pint (pull_request) Waiting to run
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
This commit is contained in:
@@ -115,15 +115,25 @@ class CreateVisitorEntry extends CreateRecord
|
|||||||
|
|
||||||
$filename = 'visitor_' . time() . '_' . uniqid() . '.jpg';
|
$filename = 'visitor_' . time() . '_' . uniqid() . '.jpg';
|
||||||
|
|
||||||
$path = 'visitor-photos/' . $filename;
|
$path = 'uploads/visitor-photos/' . $filename;
|
||||||
|
|
||||||
// Stores in storage/app/private/visitor-photos
|
Storage::disk('local')->put(
|
||||||
Storage::put(
|
$path,
|
||||||
'private/' . $path,
|
|
||||||
base64_decode($imageData)
|
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;
|
return $data;
|
||||||
|
|||||||
Reference in New Issue
Block a user