diff --git a/app/Livewire/Webcam.php b/app/Livewire/Webcam.php new file mode 100644 index 0000000..4a75467 --- /dev/null +++ b/app/Livewire/Webcam.php @@ -0,0 +1,32 @@ +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/components/webcam-field.blade.php b/resources/views/components/webcam-field.blade.php new file mode 100644 index 0000000..172331a --- /dev/null +++ b/resources/views/components/webcam-field.blade.php @@ -0,0 +1,10 @@ +