forge/bootstrap/app.php

29 lines
877 B
PHP
Raw Permalink Normal View History

2024-05-13 18:55:34 -04:00
<?php
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',
then: function () {
Route::middleware('api')
->prefix('api/v0')
->name('api.v0.')
->group(base_path('routes/api_v0.php'));
},
2024-05-13 18:55:34 -04:00
)
->withMiddleware(function (Middleware $middleware) {
2024-06-20 14:26:23 -04:00
$middleware->append(IPBanned::class);
2024-05-13 18:55:34 -04:00
})
->withExceptions(function (Exceptions $exceptions) {
//
})
->create();