forge/bootstrap/app.php

31 lines
921 B
PHP
Raw Permalink Normal View History

2024-05-13 18:55:34 -04:00
<?php
2025-01-30 00:23:55 -05:00
declare(strict_types=1);
2024-05-13 18:55:34 -04:00
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;
use Illuminate\Support\Facades\Route;
2024-06-20 14:26:23 -04:00
use Mchev\Banhammer\Middleware\IPBanned;
2024-05-13 18:55:34 -04:00
return Application::configure(basePath: dirname(__DIR__))
->withRouting(
web: __DIR__.'/../routes/web.php',
api: __DIR__.'/../routes/api.php',
commands: __DIR__.'/../routes/console.php',
health: '/up',
2025-01-30 00:23:55 -05:00
then: function (): void {
Route::middleware('api')
->prefix('api/v0')
->name('api.v0.')
->group(base_path('routes/api_v0.php'));
},
2024-05-13 18:55:34 -04:00
)
2025-01-30 00:23:55 -05:00
->withMiddleware(function (Middleware $middleware): void {
2024-06-20 14:26:23 -04:00
$middleware->append(IPBanned::class);
2024-05-13 18:55:34 -04:00
})
2025-01-30 00:23:55 -05:00
->withExceptions(function (Exceptions $exceptions): void {
2024-05-13 18:55:34 -04:00
//
})
->create();