33 lines
638 B
PHP
33 lines
638 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
class Network extends Model
|
|
{
|
|
protected $guarded = [];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [];
|
|
}
|
|
|
|
public function servers(): HasMany
|
|
{
|
|
return $this->hasMany(Server::class, 'network_id');
|
|
}
|
|
|
|
public function organisation(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Organisation::class);
|
|
}
|
|
|
|
public function provider(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Provider::class);
|
|
}
|
|
}
|