28 lines
504 B
PHP
Raw Normal View History

2024-07-30 10:44:58 +02: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 18:13:21 +02:00
protected $fillable = [
'hostname',
2024-08-16 18:20:45 +02:00
'display_name',
2024-08-16 23:37:42 +02:00
'external_id',
2024-07-30 18:13:21 +02:00
];
2024-08-06 08:31:51 +02:00
public function tasks()
{
2024-09-25 22:09:13 +02:00
return $this->hasMany(MaintenanceTask::class);
}
public function hostGroups()
{
return $this->belongsToMany(HostGroup::class)->using(HostHostGroup::class);
2024-08-06 08:31:51 +02:00
}
2024-07-30 10:44:58 +02:00
}