From 43e8a70f9cf1060df3142d81d9134b8886b65284 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Bra=C3=B1a?= Date: Mon, 11 May 2026 14:35:24 +0200 Subject: [PATCH] Add phase_id to InspectionTemplate model --- app/Models/InspectionTemplate.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/Models/InspectionTemplate.php b/app/Models/InspectionTemplate.php index 34421f1..99ba645 100644 --- a/app/Models/InspectionTemplate.php +++ b/app/Models/InspectionTemplate.php @@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Model; class InspectionTemplate extends Model { - protected $fillable = ['name', 'description', 'project_id', 'fields']; + protected $fillable = ['name', 'description', 'project_id', 'phase_id', 'fields']; protected $casts = ['fields' => 'array']; @@ -15,8 +15,13 @@ class InspectionTemplate extends Model return $this->belongsTo(Project::class); } + public function phase() + { + return $this->belongsTo(Phase::class); + } + public function inspections() { return $this->hasMany(Inspection::class); } -} +} \ No newline at end of file