-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.php
More file actions
31 lines (28 loc) · 1.06 KB
/
app.php
File metadata and controls
31 lines (28 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
use App\Http\Middleware\SetLanguage;
use CodebarAg\LaravelFeaturePolicy\AddFeaturePolicyHeaders;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;
use Spatie\Csp\AddCspHeaders;
use Spatie\Health\Commands\RunHealthChecksCommand;
use Spatie\ResponseCache\Middlewares\CacheResponse;
return Application::configure(basePath: dirname(__DIR__))
->withRouting(
web: __DIR__.'/../routes/web.php',
)
->withSchedule(function (Schedule $schedule) {
$schedule->command(RunHealthChecksCommand::class)->everyFiveMinutes();
})
->withMiddleware(function (Middleware $middleware) {
$middleware->trustProxies(at: env('TRUSTED_PROXIES') ?: '*');
$middleware->web(append: [
AddCspHeaders::class,
AddFeaturePolicyHeaders::class,
SetLanguage::class,
CacheResponse::class,
]);
})
->withExceptions(function (Exceptions $exceptions) {})
->create();