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',
|
2024-08-08 08:33:21 +00:00
|
|
|
'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);
|
|
|
|
}
|
2024-08-08 08:33:21 +00:00
|
|
|
|
|
|
|
public function guestor()
|
|
|
|
{
|
|
|
|
return $this->BelongsTo(User::class, 'guestor_id');
|
|
|
|
}
|
2024-07-30 08:44:58 +00:00
|
|
|
}
|