lthn.io/app/Website/Names/Boot.php
Claude 32d64561b2
fix: Octane compatibility — unconditional route registration
Octane registers routes once at startup when $_SERVER['HTTP_HOST']
is not available. All Website modules now register routes without
domain checks. Pool/Trade/Names subdomain routes disabled (views
not built). Home module disabled (Lethean handles homepage).

Container now serves 200 on FrankenPHP Octane.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 11:03:03 +01:00

44 lines
1 KiB
PHP

<?php
declare(strict_types=1);
namespace Website\Names;
use Core\Events\DomainResolving;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\ServiceProvider;
/**
* names.lthn.io — registrar subdomain.
* Routes disabled — Mod/Names handles /names prefix on lthn.io.
* Subdomain routing re-enabled when names.lthn.io is deployed.
*/
class Boot extends ServiceProvider
{
public static array $domains = [
'/^names\.lthn\.io$/',
];
public static array $listens = [
DomainResolving::class => 'onDomain',
];
public function register(): void {}
public function boot(): void
{
foreach (static::$listens as $event => $method) {
Event::listen($event, [$this, $method]);
}
}
public function onDomain(DomainResolving $event): void
{
foreach (static::$domains as $pattern) {
if (preg_match($pattern, $event->domain)) {
$event->resolve($this);
return;
}
}
}
}