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.

73 lines
2.8 KiB

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