40 lines
804 B
PHP
40 lines
804 B
PHP
<?php
|
|
|
|
namespace App\Modules\Maintenance\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class ChecklistItem extends Model
|
|
{
|
|
protected $table = 'maintenance_checklist_items';
|
|
|
|
protected $fillable = [
|
|
'template_id',
|
|
'spare_part_id',
|
|
'equipment_part_id',
|
|
'label',
|
|
'item_type',
|
|
'is_required',
|
|
'sort_order',
|
|
];
|
|
|
|
protected $casts = [
|
|
'is_required' => 'boolean',
|
|
];
|
|
|
|
public function template()
|
|
{
|
|
return $this->belongsTo(ChecklistTemplate::class, 'template_id');
|
|
}
|
|
|
|
public function sparePart()
|
|
{
|
|
return $this->belongsTo(SparePart::class, 'spare_part_id');
|
|
}
|
|
|
|
public function equipmentPart()
|
|
{
|
|
return $this->belongsTo(EquipmentPart::class, 'equipment_part_id');
|
|
}
|
|
}
|