$g->uuid ??= (string) Str::uuid()); // Fall back to the brand colour if an out-of-allow-list token slips in (defence in depth; // the component validates too — this guarantees the token is always a real @theme colour). static::saving(function (self $g): void { if (! in_array($g->color, self::COLORS, true)) { $g->color = 'accent'; } }); } // R11: addressed by uuid in URLs, never the bigint id. public function getRouteKeyName(): string { return 'uuid'; } public function servers(): BelongsToMany { return $this->belongsToMany(Server::class); } }