Add phase_id to InspectionTemplate model

This commit is contained in:
2026-05-11 14:35:24 +02:00
parent ca74a0c2e2
commit 43e8a70f9c
+6 -1
View File
@@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Model;
class InspectionTemplate extends 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']; protected $casts = ['fields' => 'array'];
@@ -15,6 +15,11 @@ class InspectionTemplate extends Model
return $this->belongsTo(Project::class); return $this->belongsTo(Project::class);
} }
public function phase()
{
return $this->belongsTo(Phase::class);
}
public function inspections() public function inspections()
{ {
return $this->hasMany(Inspection::class); return $this->hasMany(Inspection::class);