From 81af5bfed8b1dd88b6a547a425874f67703ce4ba Mon Sep 17 00:00:00 2001 From: joddyabott Date: Wed, 13 Aug 2025 13:41:34 +0330 Subject: [PATCH 1/3] write miotator for picture --- app/Models/SafetyAndPrivacy.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/app/Models/SafetyAndPrivacy.php b/app/Models/SafetyAndPrivacy.php index c75eaefc..0ce874f5 100644 --- a/app/Models/SafetyAndPrivacy.php +++ b/app/Models/SafetyAndPrivacy.php @@ -101,4 +101,34 @@ class SafetyAndPrivacy extends Model : Storage::disk('public')->url($value)) ); } + + protected function recognize_picture_2(): Attribute + { + return Attribute::make( + get: fn($value) => $value == null ? null : + (filter_var($value, FILTER_VALIDATE_URL) + ? $value + : Storage::disk('public')->url($value)) + ); + } + + protected function evidence_picture(): Attribute + { + return Attribute::make( + get: fn($value) => $value == null ? null : + (filter_var($value, FILTER_VALIDATE_URL) + ? $value + : Storage::disk('public')->url($value)) + ); + } + + protected function finish_picture(): Attribute + { + return Attribute::make( + get: fn($value) => $value == null ? null : + (filter_var($value, FILTER_VALIDATE_URL) + ? $value + : Storage::disk('public')->url($value)) + ); + } } From 2eb9c79f22739f2565b023dec0908dba93b9037a Mon Sep 17 00:00:00 2001 From: joddyabott Date: Wed, 13 Aug 2025 13:48:39 +0330 Subject: [PATCH 2/3] write miotator for picture --- app/Models/SafetyAndPrivacy.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Models/SafetyAndPrivacy.php b/app/Models/SafetyAndPrivacy.php index 0ce874f5..51778288 100644 --- a/app/Models/SafetyAndPrivacy.php +++ b/app/Models/SafetyAndPrivacy.php @@ -102,7 +102,7 @@ class SafetyAndPrivacy extends Model ); } - protected function recognize_picture_2(): Attribute + protected function recognizePicture2(): Attribute { return Attribute::make( get: fn($value) => $value == null ? null : @@ -112,7 +112,7 @@ class SafetyAndPrivacy extends Model ); } - protected function evidence_picture(): Attribute + protected function evidencePicture(): Attribute { return Attribute::make( get: fn($value) => $value == null ? null : @@ -122,7 +122,7 @@ class SafetyAndPrivacy extends Model ); } - protected function finish_picture(): Attribute + protected function finishPicture(): Attribute { return Attribute::make( get: fn($value) => $value == null ? null : From 3c49b1f6db610c6ec3f2d5cd69a2d9e5fcacecf3 Mon Sep 17 00:00:00 2001 From: joddyabott Date: Wed, 13 Aug 2025 13:52:18 +0330 Subject: [PATCH 3/3] fix model --- app/Models/SafetyAndPrivacy.php | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/app/Models/SafetyAndPrivacy.php b/app/Models/SafetyAndPrivacy.php index 51778288..051623f8 100644 --- a/app/Models/SafetyAndPrivacy.php +++ b/app/Models/SafetyAndPrivacy.php @@ -95,40 +95,28 @@ class SafetyAndPrivacy extends Model protected function actionPicture(): Attribute { return Attribute::make( - get: fn($value) => $value == null ? null : - (filter_var($value, FILTER_VALIDATE_URL) - ? $value - : Storage::disk('public')->url($value)) + get: fn($value) => $value == null ? null : Storage::disk('public')->url($value) ); } protected function recognizePicture2(): Attribute { return Attribute::make( - get: fn($value) => $value == null ? null : - (filter_var($value, FILTER_VALIDATE_URL) - ? $value - : Storage::disk('public')->url($value)) + get: fn($value) => $value == null ? null : Storage::disk('public')->url($value) ); } protected function evidencePicture(): Attribute { return Attribute::make( - get: fn($value) => $value == null ? null : - (filter_var($value, FILTER_VALIDATE_URL) - ? $value - : Storage::disk('public')->url($value)) + get: fn($value) => $value == null ? null : Storage::disk('public')->url($value) ); } protected function finishPicture(): Attribute { return Attribute::make( - get: fn($value) => $value == null ? null : - (filter_var($value, FILTER_VALIDATE_URL) - ? $value - : Storage::disk('public')->url($value)) + get: fn($value) => $value == null ? null : Storage::disk('public')->url($value) ); } }