lthn.io/app/Core/Front/Boot.php
Claude 41a90cbff8
feat: lthn.io API serving live chain data
Fixed: basePath self→static binding, namespace detection, event wiring,
SQLite cache, file cache driver. All Mod Boot classes converted to
$listens pattern for lifecycle event discovery.

Working endpoints:
- /v1/explorer/info — live chain height, difficulty, aliases
- /v1/explorer/stats — formatted chain statistics
- /v1/names/directory — alias directory grouped by type
- /v1/names/available/{name} — name availability check
- /v1/names/lookup/{name} — name details

Co-Authored-By: Charon <charon@lethean.io>
2026-04-03 17:17:42 +01:00

67 lines
2.1 KiB
PHP

<?php
/*
* Core PHP Framework
*
* Licensed under the European Union Public Licence (EUPL) v1.2.
* See LICENSE file for details.
*/
declare(strict_types=1);
namespace Core\Front;
use Illuminate\Foundation\Configuration\Middleware;
use Illuminate\Routing\Middleware\SubstituteBindings;
use Illuminate\Routing\Middleware\ThrottleRequests;
use Illuminate\Support\AggregateServiceProvider;
/**
* Core front-end module - I/O translation layer.
*
* Six frontages bundled in the framework, each translating a transport protocol:
* Web - HTTP → HTML (public marketing)
* Client - HTTP → HTML (namespace owner dashboard)
* Admin - HTTP → HTML (backend admin dashboard)
* Cli - Artisan commands (console context)
* Stdio - stdin/stdout (CLI pipes, MCP stdio)
* Components - View namespaces (shared across HTTP frontages)
*
* Additional frontages provided by their packages (auto-discovered):
* Api - HTTP → JSON (REST API) — php-api
* Mcp - HTTP → JSON-RPC (MCP protocol) — php-mcp
*/
class Boot extends AggregateServiceProvider
{
protected $providers = [
Web\Boot::class,
Client\Boot::class,
Admin\Boot::class,
Cli\Boot::class,
Stdio\Boot::class,
Components\Boot::class,
];
/**
* Configure HTTP middleware - delegates to each HTTP frontage.
* Stdio has no HTTP middleware (different transport).
*/
public static function middleware(Middleware $middleware): void
{
Web\Boot::middleware($middleware);
Client\Boot::middleware($middleware);
Admin\Boot::middleware($middleware);
// API and MCP groups — inlined because middleware() runs during
// Application::configure(), before package providers load.
// Packages add their own aliases during boot via lifecycle events.
$middleware->group('api', [
ThrottleRequests::class.':api',
SubstituteBindings::class,
]);
$middleware->group('mcp', [
ThrottleRequests::class.':api',
SubstituteBindings::class,
]);
}
}