Added logic to show captured image
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:
@@ -3,6 +3,7 @@
|
||||
cameraActive: false,
|
||||
captured: false,
|
||||
errorMessage: '',
|
||||
photoData: '',
|
||||
|
||||
async startCamera() {
|
||||
this.errorMessage = '';
|
||||
@@ -38,6 +39,7 @@
|
||||
}
|
||||
this.cameraActive = false;
|
||||
this.captured = true;
|
||||
this.photoData = photoData;
|
||||
|
||||
// Send photo data to PHP via Livewire
|
||||
$wire.setPhoto(photoData);
|
||||
@@ -45,6 +47,7 @@
|
||||
|
||||
retake() {
|
||||
this.captured = false;
|
||||
this.photoData = '';
|
||||
$wire.clearPhoto();
|
||||
this.$nextTick(() => this.startCamera());
|
||||
}
|
||||
@@ -84,7 +87,8 @@
|
||||
{{-- ── Captured photo preview (shown after capture) ── --}}
|
||||
<div x-show="captured" style="position: relative;">
|
||||
<img
|
||||
x-bind:src="$refs.canvas ? $refs.canvas.toDataURL('image/jpeg') : ''"
|
||||
{{-- x-bind:src="$refs.canvas ? $refs.canvas.toDataURL('image/jpeg') : ''" --}}
|
||||
x-bind:src="photoData"
|
||||
style="
|
||||
width: 100%;
|
||||
max-width: 480px;
|
||||
|
||||
Reference in New Issue
Block a user