2024-07-30 08:44:58 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
class Host extends Model
|
|
|
|
{
|
|
|
|
use HasFactory;
|
2024-07-30 16:13:21 +00:00
|
|
|
|
|
|
|
protected $fillable = [
|
|
|
|
'hostname',
|
2024-08-16 16:20:45 +00:00
|
|
|
'display_name',
|
2024-08-16 21:37:42 +00:00
|
|
|
'external_id',
|
2024-07-30 16:13:21 +00:00
|
|
|
];
|
2024-08-06 06:31:51 +00:00
|
|
|
|
|
|
|
public function tasks()
|
|
|
|
{
|
2024-09-25 20:09:13 +00:00
|
|
|
return $this->hasMany(MaintenanceTask::class);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function hostGroups()
|
|
|
|
{
|
|
|
|
return $this->belongsToMany(HostGroup::class)->using(HostHostGroup::class);
|
2024-08-06 06:31:51 +00:00
|
|
|
}
|
2024-07-30 08:44:58 +00:00
|
|
|
}
|