From aed613fcb4099175a1ff48240efc79ac35c19b5c Mon Sep 17 00:00:00 2001 From: joddyabott Date: Wed, 13 Aug 2025 14:44:49 +0330 Subject: [PATCH] fix model --- .../V3/Dashboard/SafetyAndPrivacy/OperatorController.php | 4 ++-- .../Requests/V3/SafetyAndPrivacy/FirstStepStoreRequest.php | 2 +- app/Models/SafetyAndPrivacy.php | 4 ++-- app/Services/Cartables/SafetyAndPrivacy/OperatorService.php | 2 +- ..._08_12_162810_add_pictures_to_safety_and_privacy_table.php | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/V3/Dashboard/SafetyAndPrivacy/OperatorController.php b/app/Http/Controllers/V3/Dashboard/SafetyAndPrivacy/OperatorController.php index b1ecda3a..cf03a4ae 100644 --- a/app/Http/Controllers/V3/Dashboard/SafetyAndPrivacy/OperatorController.php +++ b/app/Http/Controllers/V3/Dashboard/SafetyAndPrivacy/OperatorController.php @@ -87,8 +87,8 @@ class OperatorController extends Controller $safety_and_privacy->recognize_picture = $request->has('recognize_picture') ? FileFacade::save($request->recognize_picture, "safety_and_privacy/{$safety_and_privacy->id}") : null; - $safety_and_privacy->recognize_picture_2 = $request->has('recognize_picture_2') ? - FileFacade::save($request->recognize_picture_2, "safety_and_privacy/{$safety_and_privacy->id}") : + $safety_and_privacy->recognize_picture_second = $request->has('recognize_picture_second') ? + FileFacade::save($request->recognize_picture_second, "safety_and_privacy/{$safety_and_privacy->id}") : null; $safety_and_privacy->save(); diff --git a/app/Http/Requests/V3/SafetyAndPrivacy/FirstStepStoreRequest.php b/app/Http/Requests/V3/SafetyAndPrivacy/FirstStepStoreRequest.php index b8019d9c..b1c0f2af 100644 --- a/app/Http/Requests/V3/SafetyAndPrivacy/FirstStepStoreRequest.php +++ b/app/Http/Requests/V3/SafetyAndPrivacy/FirstStepStoreRequest.php @@ -27,7 +27,7 @@ class FirstStepStoreRequest extends FormRequest 'activity_date' => 'required|date_format:Y-m-d', 'activity_time' => 'required|date_format:H:i', 'recognize_picture' => 'required|image', - 'recognize_picture_2' => 'required|image', + 'recognize_picture_second' => 'required|image', 'axis_type_id' => 'required|integer|exists:axis_types,id', ]; } diff --git a/app/Models/SafetyAndPrivacy.php b/app/Models/SafetyAndPrivacy.php index 051623f8..8da88fec 100644 --- a/app/Models/SafetyAndPrivacy.php +++ b/app/Models/SafetyAndPrivacy.php @@ -48,7 +48,7 @@ class SafetyAndPrivacy extends Model 'supervisor_id', 'finish_picture', 'evidence_picture', - 'recognize_picture_2', + 'recognize_picture_second', ]; public $table = "safety_and_privacy"; @@ -99,7 +99,7 @@ class SafetyAndPrivacy extends Model ); } - protected function recognizePicture2(): Attribute + protected function recognize_picture_second(): Attribute { return Attribute::make( get: fn($value) => $value == null ? null : Storage::disk('public')->url($value) diff --git a/app/Services/Cartables/SafetyAndPrivacy/OperatorService.php b/app/Services/Cartables/SafetyAndPrivacy/OperatorService.php index 336590b0..c840e5d8 100644 --- a/app/Services/Cartables/SafetyAndPrivacy/OperatorService.php +++ b/app/Services/Cartables/SafetyAndPrivacy/OperatorService.php @@ -18,7 +18,7 @@ class OperatorService 'id','lat','lon', 'recognize_picture','action_picture','created_at','step', 'final_description', 'info_fa', 'activity_date_time', 'action_picture_document_upload_date', 'judiciary_document_upload_date', 'step_fa', 'axis_type_id', 'axis_type_name', 'action_date', 'is_finished', 'status_fa', 'supervisor_description', - 'operator_description', 'finish_picture', 'evidence_picture', 'recognize_picture_2' + 'operator_description', 'finish_picture', 'evidence_picture', 'recognize_picture_second' ]; throw_if(is_null($user->edarate_shahri_id), new ProhibitedAction('اداره ای برای شما در سامانه ثبت نشده است!')); diff --git a/database/migrations/2025_08_12_162810_add_pictures_to_safety_and_privacy_table.php b/database/migrations/2025_08_12_162810_add_pictures_to_safety_and_privacy_table.php index c213bc46..cc8974e4 100644 --- a/database/migrations/2025_08_12_162810_add_pictures_to_safety_and_privacy_table.php +++ b/database/migrations/2025_08_12_162810_add_pictures_to_safety_and_privacy_table.php @@ -12,7 +12,7 @@ return new class extends Migration public function up(): void { Schema::table('safety_and_privacy', function (Blueprint $table) { - $table->string('recognize_picture_2')->nullable(); + $table->string('recognize_picture_second')->nullable(); $table->string('finish_picture')->nullable(); $table->string('evidence_picture')->nullable(); }); @@ -24,7 +24,7 @@ return new class extends Migration public function down(): void { Schema::table('safety_and_privacy', function (Blueprint $table) { - $table->dropColumn(['recognize_picture_2', 'finish_picture', 'evidence_picture']); + $table->dropColumn(['recognize_picture_second', 'finish_picture', 'evidence_picture']); }); } };