2025-07-10 18:23:56 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
use Illuminate\Foundation\Application;
|
|
|
|
|
use Illuminate\Foundation\Configuration\Exceptions;
|
|
|
|
|
use Illuminate\Foundation\Configuration\Middleware;
|
|
|
|
|
|
|
|
|
|
return Application::configure(basePath: dirname(__DIR__))
|
|
|
|
|
->withRouting(
|
2025-10-11 13:38:30 +00:00
|
|
|
web: __DIR__ . '/../routes/web.php',
|
|
|
|
|
commands: __DIR__ . '/../routes/console.php',
|
|
|
|
|
api: __DIR__ . '/../routes/api.php',
|
2025-07-10 18:23:56 +00:00
|
|
|
health: '/up',
|
|
|
|
|
)
|
|
|
|
|
->withMiddleware(function (Middleware $middleware): void {
|
2025-10-11 13:38:30 +00:00
|
|
|
$middleware->group('web', [
|
|
|
|
|
\Illuminate\Cookie\Middleware\EncryptCookies::class,
|
|
|
|
|
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
|
|
|
|
|
\Illuminate\Session\Middleware\StartSession::class,
|
|
|
|
|
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
|
|
|
|
\Illuminate\Foundation\Http\Middleware\ValidateCsrfToken::class,
|
|
|
|
|
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
|
|
|
|
// \Illuminate\Session\Middleware\AuthenticateSession::class,
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$middleware->group('api', [
|
|
|
|
|
// \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
|
|
|
|
|
// 'throttle:api',
|
|
|
|
|
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
|
|
|
|
]);
|
|
|
|
|
$middleware->group('admin', [
|
|
|
|
|
\Illuminate\Routing\Middleware\SubstituteBindings::class
|
|
|
|
|
]);
|
2025-07-10 18:23:56 +00:00
|
|
|
})
|
|
|
|
|
->withExceptions(function (Exceptions $exceptions): void {
|
2025-10-11 13:38:30 +00:00
|
|
|
|
2025-07-10 18:23:56 +00:00
|
|
|
})->create();
|