Kernel.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <?php
  2. namespace App\Http;
  3. use App\Http\Middleware\AdminRequestLog;
  4. use App\Http\Middleware\CheckTokenMiddleware;
  5. use App\Http\Middleware\EnableCrossRequestMiddleware;
  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
  15. */
  16. protected $middleware = [
  17. \App\Http\Middleware\TrustProxies::class,
  18. \App\Http\Middleware\CheckForMaintenanceMode::class,
  19. \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
  20. \App\Http\Middleware\TrimStrings::class,
  21. \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
  22. // \App\Http\Middleware\CrossHttp::class,
  23. // EnableCrossRequestMiddleware::class,
  24. // \Fruitcake\Cors\HandleCors::class,
  25. ];
  26. /**
  27. * The application's route middleware groups.
  28. *
  29. * @var array
  30. */
  31. protected $middlewareGroups = [
  32. 'web' => [
  33. 'throttle:60,1',
  34. 'bindings',
  35. 'cors',
  36. ],
  37. 'admin' => [
  38. 'throttle:500,1',
  39. 'bindings',
  40. 'cors',
  41. 'admin_request_info'
  42. // \Fruitcake\Cors\HandleCors::class
  43. ],
  44. 'api' => [
  45. 'throttle:60,1',
  46. 'bindings',
  47. 'cors',
  48. ],
  49. ];
  50. /**
  51. * The application's route middleware.
  52. *
  53. * These middleware may be assigned to groups or used individually.
  54. *
  55. * @var array
  56. */
  57. protected $routeMiddleware = [
  58. 'auth' => \App\Http\Middleware\Authenticate::class,
  59. 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
  60. 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
  61. 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
  62. 'can' => \Illuminate\Auth\Middleware\Authorize::class,
  63. 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
  64. 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
  65. 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
  66. 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
  67. 'check.token'=>CheckTokenMiddleware::class,
  68. 'cors' => \App\Http\Middleware\CrossHttp::class,
  69. 'check_token' => \App\Http\Middleware\CheckTokenMiddleware::class,
  70. 'admin_request_info'=>AdminRequestLog::class
  71. // 'cors' => \Fruitcake\Cors\HandleCors::class,
  72. // 'admin_cros'=>EnableCrossRequestMiddleware::class
  73. ];
  74. /**
  75. * The priority-sorted list of middleware.
  76. *
  77. * This forces non-global middleware to always be in the given order.
  78. *
  79. * @var array
  80. */
  81. protected $middlewarePriority = [
  82. \Illuminate\Session\Middleware\StartSession::class,
  83. \Illuminate\View\Middleware\ShareErrorsFromSession::class,
  84. \App\Http\Middleware\Authenticate::class,
  85. \Illuminate\Routing\Middleware\ThrottleRequests::class,
  86. \Illuminate\Session\Middleware\AuthenticateSession::class,
  87. \Illuminate\Routing\Middleware\SubstituteBindings::class,
  88. \Illuminate\Auth\Middleware\Authorize::class,
  89. ];
  90. }