added delete option

This commit is contained in:
DigitalInfinity committed 2026-05-26 22:53:13 +02:00
1 parent 079f65bc5f
commit c900f1bf68
2 files changed
+18 -1

No files matched your search

+11
View File
@@ -11,6 +11,17 @@ class CameraCapture extends Component
{
public string $status = '';
public function delete(int $jobId): void
{
$job = PhotoJob::find($jobId);
if (!$job) return;
Storage::disk('public')->delete($job->image_path);
$job->delete();
$this->status = "Job #{$jobId} deleted";
}
public function capture(string $imageData): void
{
if (!preg_match('/^data:image\/(\w+);base64,/', $imageData, $type)) {