Kernel.php 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. namespace App\Http;
  3. use App\Http\Middleware\LimitRequestMiddleware;
  4. use App\Http\Middleware\LimitSmsRequestMiddleware;
  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. \Fruitcake\Cors\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\Session\Middleware\AuthenticateSession::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. 'throttles:api',
  43. 'bindings',
  44. \Illuminate\Routing\Middleware\SubstituteBindings::class,
  45. ],
  46. 'admin' => [
  47. // 'throttle:500,1',
  48. \Fruitcake\Cors\HandleCors::class,
  49. \Illuminate\Routing\Middleware\SubstituteBindings::class,
  50. ],
  51. ];
  52. /**
  53. * The application's route middleware.
  54. *
  55. * These middleware may be assigned to groups or used individually.
  56. *
  57. * @var array<string, class-string|string>
  58. */
  59. protected $routeMiddleware = [
  60. 'auth' => \App\Http\Middleware\Authenticate::class,
  61. 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
  62. 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
  63. 'can' => \Illuminate\Auth\Middleware\Authorize::class,
  64. 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
  65. 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
  66. 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
  67. 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
  68. 'throttles' => LimitRequestMiddleware::class,
  69. 'throttlesms' => LimitSmsRequestMiddleware::class,
  70. 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
  71. 'check_token' => \App\Http\Middleware\CheckTokenMiddleware::class,
  72. ];
  73. }