From bf2cbbe00a772d596eb907425142bbe253eeaefd Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Wed, 27 May 2026 11:39:33 +0530 Subject: [PATCH] Added webcam livewire pages --- app/Livewire/Webcam.php | 33 ++++ resources/views/livewire/webcam.blade.php | 193 ++++++++++++++++++++++ 2 files changed, 226 insertions(+) create mode 100644 app/Livewire/Webcam.php create mode 100644 resources/views/livewire/webcam.blade.php diff --git a/app/Livewire/Webcam.php b/app/Livewire/Webcam.php new file mode 100644 index 0000000..e53672f --- /dev/null +++ b/app/Livewire/Webcam.php @@ -0,0 +1,33 @@ +capturedPhoto = $photo; + + // Fires a browser event that the Filament form will listen to + $this->dispatch('photo-captured', photo: $photo); + } + + // Called from JavaScript when user clicks "Retake" + public function clearPhoto(): void + { + $this->capturedPhoto = ''; + + $this->dispatch('photo-captured', photo: ''); + } + public function render() + { + return view('livewire.webcam'); + } +} + diff --git a/resources/views/livewire/webcam.blade.php b/resources/views/livewire/webcam.blade.php new file mode 100644 index 0000000..1d5407b --- /dev/null +++ b/resources/views/livewire/webcam.blade.php @@ -0,0 +1,193 @@ +
+ {{-- ── Error message ── --}} + + + {{-- ── Live video feed (shown while camera is active) ── --}} +
+ +
+ + {{-- ── Captured photo preview (shown after capture) ── --}} +
+ Captured visitor photo +
✓ Photo captured
+
+ + {{-- ── Placeholder (before camera starts) ── --}} +
+ 📷 Camera not started yet +
+ + {{-- ── Hidden canvas used for capturing the frame ── --}} + + + {{-- ── Buttons ── --}} +
+ + {{-- Start Camera button --}} + + + {{-- Capture button --}} + + + {{-- Retake button --}} + + +
+