Added camera capture in ocr

This commit is contained in:
dhanabalan
2025-10-17 10:18:45 +05:30
parent 1fb3930098
commit 1dec47a05f

View File

@@ -51,11 +51,8 @@ document.addEventListener('DOMContentLoaded', () => {
<x-filament::button color="secondary" @click="retakePhoto" x-show="photoTaken">Retake</x-filament::button> <x-filament::button color="secondary" @click="retakePhoto" x-show="photoTaken">Retake</x-filament::button>
<x-filament::button color="gray" @click="switchCamera" x-show="!photoTaken">Switch Camera</x-filament::button> <x-filament::button color="gray" @click="switchCamera" x-show="!photoTaken">Switch Camera</x-filament::button>
</div> </div>
{{--
<input type="hidden" name="{{ $getName() }}" x-ref="hiddenInput"> --}}
{{-- <input type="hidden" name="photo_data" x-ref="hiddenInput"> --}}
<input type="hidden" x-ref="hiddenInput" x-model="photo1">
<input type="hidden" name="{{ $getName() }}" x-ref="hiddenInput">
</div> </div>
<script> <script>
@@ -106,17 +103,13 @@ function cameraCapture() {
snapshot.classList.remove('hidden'); snapshot.classList.remove('hidden');
this.photoTaken = true; this.photoTaken = true;
@this.set('photo1', dataUrl); this.$refs.hiddenInput.value = dataUrl;
// this.$refs.hiddenInput.value = dataUrl;
}, },
async retakePhoto() { async retakePhoto() {
this.photoTaken = false; this.photoTaken = false;
this.$refs.snapshot.classList.add('hidden'); this.$refs.snapshot.classList.add('hidden');
this.$refs.video.classList.remove('hidden'); //this.$refs.video.classList.remove('hidden');
await this.initCamera(); await this.initCamera();
} }
} }