2026-04-03 16:13:55 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace Mod\Explorer;
|
|
|
|
|
|
2026-04-04 12:51:53 +01:00
|
|
|
use Core\Events\ApiRoutesRegistering;
|
2026-04-03 17:17:42 +01:00
|
|
|
use Core\Events\WebRoutesRegistering;
|
2026-04-03 16:13:55 +01:00
|
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
|
|
|
|
|
|
class Boot
|
|
|
|
|
{
|
2026-04-03 17:17:42 +01:00
|
|
|
public static array $listens = [
|
|
|
|
|
WebRoutesRegistering::class => 'onWebRoutes',
|
2026-04-04 12:51:53 +01:00
|
|
|
ApiRoutesRegistering::class => 'onApiRoutes',
|
2026-04-03 17:17:42 +01:00
|
|
|
];
|
2026-04-03 16:13:55 +01:00
|
|
|
|
2026-04-04 09:13:34 +01:00
|
|
|
public function onWebRoutes(WebRoutesRegistering $event): void
|
2026-04-03 16:13:55 +01:00
|
|
|
{
|
2026-04-04 09:13:34 +01:00
|
|
|
$event->views('explorer', __DIR__ . '/Views');
|
2026-04-04 09:36:59 +01:00
|
|
|
$event->routes(fn () => Route::prefix('explorer')->group(__DIR__ . '/Routes/web.php'));
|
2026-04-03 16:13:55 +01:00
|
|
|
}
|
2026-04-04 12:51:53 +01:00
|
|
|
|
|
|
|
|
public function onApiRoutes(ApiRoutesRegistering $event): void
|
|
|
|
|
{
|
|
|
|
|
$event->routes(fn () => Route::prefix('v1/explorer')->group(__DIR__ . '/Routes/api.php'));
|
|
|
|
|
}
|
2026-04-03 16:13:55 +01:00
|
|
|
}
|