Kernel.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <?php
  2. namespace App\Http;
  3. use App\Http\Middleware\IsAdmin;
  4. use App\Http\Middleware\IsSeller;
  5. use App\Http\Middleware\IsSalesman;
  6. use App\Http\Middleware\IsCustomer;
  7. use App\Http\Middleware\IsUser;
  8. use App\Http\Middleware\CheckoutMiddleware;
  9. use App\Http\Middleware\IsUnbanned;
  10. use App\Http\Middleware\AppLanguage;
  11. use Illuminate\Foundation\Http\Kernel as HttpKernel;
  12. class Kernel extends HttpKernel
  13. {
  14. /**
  15. * The application's global HTTP middleware stack.
  16. *
  17. * These middleware are run during every request to your application.
  18. *
  19. * @var array
  20. */
  21. protected $middleware = [
  22. \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
  23. \App\Http\Middleware\TrimStrings::class,
  24. \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
  25. \App\Http\Middleware\TrustProxies::class,
  26. ];
  27. /**
  28. * The application's route middleware groups.
  29. *
  30. * @var array
  31. */
  32. protected $middlewareGroups = [
  33. 'web' => [
  34. //\App\Http\Middleware\EncryptCookies::class,
  35. \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
  36. \Illuminate\Session\Middleware\StartSession::class,
  37. // \Illuminate\Session\Middleware\AuthenticateSession::class,
  38. \Illuminate\View\Middleware\ShareErrorsFromSession::class,
  39. // \App\Http\Middleware\VerifyCsrfToken::class,
  40. \Illuminate\Routing\Middleware\SubstituteBindings::class,
  41. \App\Http\Middleware\Language::class,
  42. \App\Http\Middleware\HttpsProtocol::class,
  43. \App\Http\Middleware\CheckForMaintenanceMode::class
  44. ],
  45. 'api' => [
  46. \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
  47. 'throttle:api',
  48. \Illuminate\Routing\Middleware\SubstituteBindings::class,
  49. ],
  50. ];
  51. /**
  52. * The application's route middleware.
  53. *
  54. * These middleware may be assigned to groups or used individually.
  55. *
  56. * @var array
  57. */
  58. protected $routeMiddleware = [
  59. 'app_language' => AppLanguage::class,
  60. 'admin' => IsAdmin::class,
  61. 'seller' => IsSeller::class,
  62. 'salesman' => IsSalesman::class,
  63. 'customer' => IsCustomer::class,
  64. 'user' => IsUser::class,
  65. 'unbanned' => IsUnbanned::class,
  66. 'checkout' => CheckoutMiddleware::class,
  67. 'auth' => \App\Http\Middleware\Authenticate::class,
  68. 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
  69. 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
  70. 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
  71. 'can' => \Illuminate\Auth\Middleware\Authorize::class,
  72. 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
  73. 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
  74. 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
  75. 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
  76. ];
  77. /**
  78. * The priority-sorted list of middleware.
  79. *
  80. * This forces the listed middleware to always be in the given order.
  81. *
  82. * @var array
  83. */
  84. protected $middlewarePriority = [
  85. \Illuminate\Session\Middleware\StartSession::class,
  86. \Illuminate\View\Middleware\ShareErrorsFromSession::class,
  87. \App\Http\Middleware\Authenticate::class,
  88. \Illuminate\Session\Middleware\AuthenticateSession::class,
  89. \Illuminate\Routing\Middleware\SubstituteBindings::class,
  90. \Illuminate\Auth\Middleware\Authorize::class,
  91. ];
  92. }