LAR_Maintenance/app/Models/Maintenance.php
2024-08-06 08:31:51 +02:00

33 lines
616 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Maintenance extends Model
{
use HasFactory;
protected $fillable = [
'name',
'description',
'schedule',
];
public function history()
{
return $this->hasMany(MaintenanceHistory::class);
}
public function hosts()
{
return $this->belongsToMany(Host::class, "maintenance_host", "maintenance_id", "host_id" );
}
public function tasks()
{
return $this->hasMany(MaintenanceTask::class,);
}
}