ultimatepos/Modules/Maintenance/Models/DispatchBoardEntry.php

50 lines
1.0 KiB
PHP

<?php
namespace Modules\Maintenance\Models;
use App\Business;
use App\User;
use Illuminate\Database\Eloquent\Model;
class DispatchBoardEntry extends Model
{
protected $table = 'maintenance_dispatch_board';
protected $fillable = [
'business_id',
'work_order_id',
'preventive_schedule_id',
'technician_id',
'scheduled_start',
'scheduled_end',
'dispatch_status',
'priority',
'notes',
];
protected $casts = [
'scheduled_start' => 'datetime',
'scheduled_end' => 'datetime',
];
public function business()
{
return $this->belongsTo(Business::class);
}
public function workOrder()
{
return $this->belongsTo(WorkOrder::class, 'work_order_id');
}
public function preventiveSchedule()
{
return $this->belongsTo(PreventiveSchedule::class, 'preventive_schedule_id');
}
public function technician()
{
return $this->belongsTo(User::class, 'technician_id');
}
}