You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
2.7 KiB

2 years ago
2 years ago
2 years ago
  1. <?php
  2. namespace App\Http;
  3. use App\Http\Middleware\BindCollectionModelMiddleware;
  4. use App\Http\Middleware\BindModelDocumentMiddleware;
  5. use Illuminate\Foundation\Http\Kernel as HttpKernel;
  6. class Kernel extends HttpKernel
  7. {
  8. /**
  9. * The application's global HTTP middleware stack.
  10. *
  11. * These middleware are run during every request to your application.
  12. *
  13. * @var array<int, class-string|string>
  14. */
  15. protected $middleware = [
  16. // \App\Http\Middleware\TrustHosts::class,
  17. \App\Http\Middleware\TrustProxies::class,
  18. \Illuminate\Http\Middleware\HandleCors::class,
  19. \App\Http\Middleware\PreventRequestsDuringMaintenance::class,
  20. \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
  21. \App\Http\Middleware\TrimStrings::class,
  22. \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
  23. ];
  24. /**
  25. * The application's route middleware groups.
  26. *
  27. * @var array<string, array<int, class-string|string>>
  28. */
  29. protected $middlewareGroups = [
  30. 'web' => [
  31. \App\Http\Middleware\EncryptCookies::class,
  32. \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
  33. \Illuminate\Session\Middleware\StartSession::class,
  34. \Illuminate\View\Middleware\ShareErrorsFromSession::class,
  35. \App\Http\Middleware\VerifyCsrfToken::class,
  36. \Illuminate\Routing\Middleware\SubstituteBindings::class,
  37. ],
  38. 'api' => [
  39. // \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
  40. 'throttle:api',
  41. \Illuminate\Routing\Middleware\SubstituteBindings::class,
  42. // BindModelDocumentMiddleware::class,
  43. BindCollectionModelMiddleware::class
  44. ],
  45. ];
  46. /**
  47. * The application's route middleware.
  48. *
  49. * These middleware may be assigned to groups or used individually.
  50. *
  51. * @var array<string, class-string|string>
  52. */
  53. protected $routeMiddleware = [
  54. 'auth' => \App\Http\Middleware\Authenticate::class,
  55. 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
  56. 'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class,
  57. 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
  58. 'can' => \Illuminate\Auth\Middleware\Authorize::class,
  59. 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
  60. 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
  61. 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
  62. 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
  63. 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
  64. ];
  65. }