diff --git a/app/Website/Explorer/Boot.php b/app/Website/Explorer/Boot.php index ad688a5..7b10f77 100644 --- a/app/Website/Explorer/Boot.php +++ b/app/Website/Explorer/Boot.php @@ -13,12 +13,14 @@ use Illuminate\Support\ServiceProvider; /** * Block Explorer website. * - * Serves explorer.lthn.io (prod) or /explorer path on lthn.io. + * On explorer.lthn.io: serves routes at root (/). + * On lthn.io: Mod/Explorer handles /explorer prefix. */ class Boot extends ServiceProvider { public static array $domains = [ '/^explorer\.lthn\.io$/', + '/^explorer\.(test|localhost)$/', ]; public static array $listens = [ @@ -30,8 +32,6 @@ class Boot extends ServiceProvider public function boot(): void { - $this->loadViewsFrom(__DIR__ . '/Views', 'explorer'); - foreach (static::$listens as $event => $method) { Event::listen($event, [$this, $method]); } @@ -47,8 +47,18 @@ class Boot extends ServiceProvider } } - public function onWebRoutes(): void + public function onWebRoutes(WebRoutesRegistering $event): void { - Route::prefix('explorer')->group(__DIR__ . '/Routes/web.php'); + $host = $_SERVER['HTTP_HOST'] ?? ''; + + foreach (static::$domains as $pattern) { + if (preg_match($pattern, $host)) { + // On explorer.lthn.io — serve at root + $event->routes(fn () => Route::group([], __DIR__ . '/Routes/web.php')); + return; + } + } + + // On other domains — no routes (Mod/Explorer handles /explorer prefix) } }