LAR_Maintenance/app/Models/MaintenanceHistory.php

34 lines
629 B
PHP
Raw Normal View History

2024-07-30 08:44:58 +00:00
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class MaintenanceHistory extends Model
{
use HasFactory;
2024-07-31 15:04:33 +00:00
protected $fillable = [
'maintenance_id',
'start_at',
'finished_at',
'guestor_id',
2024-07-31 15:04:33 +00:00
];
public function maintenance()
{
return $this->BelongsTo(Maintenance::class);
}
2024-08-06 09:02:45 +00:00
public function historyHosts()
{
return $this->hasMany(MaintenanceHostHistory::class);
}
public function guestor()
{
return $this->BelongsTo(User::class, 'guestor_id');
}
2024-07-30 08:44:58 +00:00
}