Kernel.php 2.5 KB

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