100 lines
3.3 KiB
PHP
100 lines
3.3 KiB
PHP
<?php
|
|
|
|
/** @noinspection PhpPropertyNamingConventionInspection */
|
|
|
|
/** @noinspection EfferentObjectCouplingInspection */
|
|
|
|
namespace App\Http;
|
|
|
|
use App\Http\Middleware\Authenticate;
|
|
use App\Http\Middleware\CheckConfigurationMiddleware;
|
|
use App\Http\Middleware\EncryptCookies;
|
|
use App\Http\Middleware\HandleInertiaRequests;
|
|
use App\Http\Middleware\LocaleMiddleware;
|
|
use App\Http\Middleware\PreventRequestsDuringMaintenance;
|
|
use App\Http\Middleware\RedirectIfAuthenticated;
|
|
use App\Http\Middleware\TrimStrings;
|
|
use App\Http\Middleware\TrustProxies;
|
|
use App\Http\Middleware\VerifyCsrfToken;
|
|
use Illuminate\Auth\Middleware\AuthenticateWithBasicAuth;
|
|
use Illuminate\Auth\Middleware\Authorize;
|
|
use Illuminate\Auth\Middleware\EnsureEmailIsVerified;
|
|
use Illuminate\Auth\Middleware\RequirePassword;
|
|
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
|
|
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
|
use Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull;
|
|
use Illuminate\Foundation\Http\Middleware\ValidatePostSize;
|
|
use Illuminate\Http\Middleware\HandleCors;
|
|
use Illuminate\Http\Middleware\SetCacheHeaders;
|
|
use Illuminate\Routing\Middleware\SubstituteBindings;
|
|
use Illuminate\Routing\Middleware\ThrottleRequests;
|
|
use Illuminate\Routing\Middleware\ValidateSignature;
|
|
use Illuminate\Session\Middleware\StartSession;
|
|
use Illuminate\View\Middleware\ShareErrorsFromSession;
|
|
use Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful;
|
|
|
|
class Kernel extends HttpKernel
|
|
{
|
|
/**
|
|
* The application's global HTTP middleware stack.
|
|
*
|
|
* These middlewares are run during every request to your application.
|
|
*
|
|
* @var array<int, string>
|
|
*/
|
|
protected $middleware = [
|
|
// \App\Http\Middleware\TrustHosts::class,
|
|
TrustProxies::class,
|
|
HandleCors::class,
|
|
PreventRequestsDuringMaintenance::class,
|
|
ValidatePostSize::class,
|
|
TrimStrings::class,
|
|
ConvertEmptyStringsToNull::class,
|
|
];
|
|
|
|
/**
|
|
* The application's route middleware groups.
|
|
*
|
|
* @var array<string, array<int, string>>
|
|
*/
|
|
protected $middlewareGroups = [
|
|
'web' => [
|
|
EncryptCookies::class,
|
|
AddQueuedCookiesToResponse::class,
|
|
StartSession::class,
|
|
// \Illuminate\Session\Middleware\AuthenticateSession::class,
|
|
ShareErrorsFromSession::class,
|
|
VerifyCsrfToken::class,
|
|
SubstituteBindings::class,
|
|
LocaleMiddleware::class,
|
|
CheckConfigurationMiddleware::class,
|
|
HandleInertiaRequests::class,
|
|
],
|
|
|
|
'api' => [
|
|
EnsureFrontendRequestsAreStateful::class,
|
|
'throttle:api',
|
|
SubstituteBindings::class,
|
|
],
|
|
];
|
|
|
|
/**
|
|
* The application's route middleware.
|
|
*
|
|
* These middlewares may be assigned to a group or used individually.
|
|
*
|
|
* @var array<string, string>
|
|
*/
|
|
protected $middlewareAliases = [
|
|
'auth' => Authenticate::class,
|
|
'auth.basic' => AuthenticateWithBasicAuth::class,
|
|
'cache.headers' => SetCacheHeaders::class,
|
|
'can' => Authorize::class,
|
|
'guest' => RedirectIfAuthenticated::class,
|
|
'password.confirm' => RequirePassword::class,
|
|
'signed' => ValidateSignature::class,
|
|
'throttle' => ThrottleRequests::class,
|
|
'verified' => EnsureEmailIsVerified::class,
|
|
];
|
|
}
|