28 lines
504 B
PHP
28 lines
504 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Host extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'hostname',
|
|
'display_name',
|
|
'external_id',
|
|
];
|
|
|
|
public function tasks()
|
|
{
|
|
return $this->hasMany(MaintenanceTask::class);
|
|
}
|
|
|
|
public function hostGroups()
|
|
{
|
|
return $this->belongsToMany(HostGroup::class)->using(HostHostGroup::class);
|
|
}
|
|
}
|