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