belongsTo(Equipment::class, 'equipment_id'); } public function inspector(): BelongsTo { return $this->belongsTo(\App\Models\User::class, 'inspector_id'); } public function details(): HasMany { return $this->hasMany(EquipmentInspectionDetail::class, 'inspection_id'); } public function getJudgmentLabelAttribute(): string { return match ($this->overall_judgment) { 'OK' => '양호', 'NG' => '이상', default => '-', }; } public function getJudgmentColorAttribute(): string { return match ($this->overall_judgment) { 'OK' => 'bg-green-100 text-green-800', 'NG' => 'bg-red-100 text-red-800', default => 'bg-gray-100 text-gray-800', }; } }