New direction; removed wireguard, readme update
This commit is contained in:
@@ -27,27 +27,11 @@ class Server extends Model
|
||||
public static function boot(): void
|
||||
{
|
||||
parent::boot();
|
||||
|
||||
static::creating(function (self $server) {
|
||||
$existingServer = Server::whereOrganisationId($server->organisation_id)
|
||||
->orderByDesc('internal_ip_ending')
|
||||
->first();
|
||||
|
||||
$server->internal_ip_ending = $existingServer
|
||||
? $existingServer->internal_ip_ending + 1
|
||||
: 2;
|
||||
$server->internal_ip = config('keystone.internal_ip_base') . $server->internal_ip_ending;
|
||||
});
|
||||
}
|
||||
|
||||
public function externalNetwork(): BelongsTo
|
||||
public function network(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Network::class, 'external_network_id');
|
||||
}
|
||||
|
||||
public function internalNetwork(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Network::class, 'internal_network_id');
|
||||
return $this->belongsTo(Network::class, 'network');
|
||||
}
|
||||
|
||||
public function organisation(): BelongsTo
|
||||
|
||||
Reference in New Issue
Block a user