Files
cv4/bootstrap/app.php
2025-01-18 19:05:23 -05:00

33 lines
1.1 KiB
PHP

<?php
use App\Http\Middleware\HandleInertiaRequests;
use GuzzleHttp\Exception\ServerException;
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;
use Illuminate\Http\Middleware\AddLinkHeadersForPreloadedAssets;
use Sentry\Laravel\Integration;
return Application::configure(basePath: dirname(__DIR__))
->withRouting(
web: __DIR__.'/../routes/web.php',
api: __DIR__.'/../routes/api.php',
commands: __DIR__.'/../routes/console.php',
health: '/up',
)
->withMiddleware(function (Middleware $middleware) {
$middleware->web(append: [
HandleInertiaRequests::class,
AddLinkHeadersForPreloadedAssets::class,
]);
$middleware->statefulApi();
//
})
->withExceptions(function (Exceptions $exceptions) {
$exceptions->render(function (ServerException $e, Request $request) {
return response()->view('errors', status: 500);
});
Integration::handles($exceptions);
})->create();