33 lines
616 B
PHP
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,);
|
|
}
|
|
}
|