]> BookStack Code Mirror - bookstack/blob - app/Http/Kernel.php
Maintenance: Addressed a range of phpstan level 3 issues
[bookstack] / app / Http / Kernel.php
1 <?php
2
3 namespace BookStack\Http;
4
5 use Illuminate\Foundation\Http\Kernel as HttpKernel;
6
7 class Kernel extends HttpKernel
8 {
9     /**
10      * The application's global HTTP middleware stack.
11      * These middleware are run during every request to your application.
12      *
13      * @var list<class-string>
14      */
15     protected $middleware = [
16         \BookStack\Http\Middleware\PreventRequestsDuringMaintenance::class,
17         \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
18         \BookStack\Http\Middleware\TrimStrings::class,
19         \BookStack\Http\Middleware\TrustProxies::class,
20         \BookStack\Http\Middleware\PreventResponseCaching::class,
21     ];
22
23     /**
24      * The application's route middleware groups.
25      *
26      * @var array<string, array<int, class-string>>
27      */
28     protected $middlewareGroups = [
29         'web' => [
30             \BookStack\Http\Middleware\ApplyCspRules::class,
31             \BookStack\Http\Middleware\EncryptCookies::class,
32             \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
33             \BookStack\Http\Middleware\StartSessionExtended::class,
34             \Illuminate\View\Middleware\ShareErrorsFromSession::class,
35             \BookStack\Http\Middleware\VerifyCsrfToken::class,
36             \BookStack\Http\Middleware\CheckEmailConfirmed::class,
37             \BookStack\Http\Middleware\RunThemeActions::class,
38             \BookStack\Http\Middleware\Localization::class,
39         ],
40         'api' => [
41             \BookStack\Http\Middleware\ThrottleApiRequests::class,
42             \BookStack\Http\Middleware\EncryptCookies::class,
43             \BookStack\Http\Middleware\StartSessionIfCookieExists::class,
44             \BookStack\Http\Middleware\ApiAuthenticate::class,
45             \BookStack\Http\Middleware\CheckEmailConfirmed::class,
46         ],
47     ];
48
49     /**
50      * The application's middleware aliases.
51      *
52      * @var array<string, class-string>
53      */
54     protected $middlewareAliases = [
55         'auth'       => \BookStack\Http\Middleware\Authenticate::class,
56         'can'        => \BookStack\Http\Middleware\CheckUserHasPermission::class,
57         'guest'      => \BookStack\Http\Middleware\RedirectIfAuthenticated::class,
58         'throttle'   => \Illuminate\Routing\Middleware\ThrottleRequests::class,
59         'guard'      => \BookStack\Http\Middleware\CheckGuard::class,
60         'mfa-setup'  => \BookStack\Http\Middleware\AuthenticatedOrPendingMfa::class,
61     ];
62 }