lthn.io/app/Mod/Explorer/Boot.php

29 lines
750 B
PHP
Raw Permalink Normal View History

<?php
declare(strict_types=1);
namespace Mod\Explorer;
use Core\Events\ApiRoutesRegistering;
use Core\Events\WebRoutesRegistering;
use Illuminate\Support\Facades\Route;
class Boot
{
public static array $listens = [
WebRoutesRegistering::class => 'onWebRoutes',
ApiRoutesRegistering::class => 'onApiRoutes',
];
public function onWebRoutes(WebRoutesRegistering $event): void
{
$event->views('explorer', __DIR__ . '/Views');
$event->routes(fn () => Route::prefix('explorer')->group(__DIR__ . '/Routes/web.php'));
}
public function onApiRoutes(ApiRoutesRegistering $event): void
{
$event->routes(fn () => Route::prefix('v1/explorer')->group(__DIR__ . '/Routes/api.php'));
}
}