Kernel.php 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. namespace App\Http;
  3. use App\Http\Middleware\AppVerify;
  4. use App\Http\Middleware\DataEncrypt;
  5. use App\Http\Middleware\EncryptCookies;
  6. use App\Http\Middleware\HttpsToHttp;
  7. use App\Http\Middleware\Permission;
  8. use App\Http\Middleware\Response;
  9. use Illuminate\Foundation\Http\Kernel as HttpKernel;
  10. use Kamicloud\StubApi\Http\Middleware\GeneratorMiddleware;
  11. class Kernel extends HttpKernel
  12. {
  13. /**
  14. * The application's global HTTP middleware stack.
  15. *
  16. * These middleware are run during every request to your application.
  17. *
  18. * @var array
  19. */
  20. protected $middleware = [
  21. \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
  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. Response::class,
  27. ];
  28. /**
  29. * The application's route middleware groups.
  30. *
  31. * @var array
  32. */
  33. protected $middlewareGroups = [
  34. 'web' => [
  35. EncryptCookies::class,
  36. HttpsToHttp::class,
  37. \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
  38. \Illuminate\Session\Middleware\StartSession::class,
  39. \Illuminate\View\Middleware\ShareErrorsFromSession::class,
  40. \Illuminate\Routing\Middleware\SubstituteBindings::class,
  41. ],
  42. 'api' => [
  43. \Barryvdh\Cors\HandleCors::class,
  44. AppVerify::class,
  45. Permission::class,
  46. 'bindings',
  47. ],
  48. 'stub-api' => [
  49. \Barryvdh\Cors\HandleCors::class,
  50. GeneratorMiddleware::class,
  51. ],
  52. ];
  53. /**
  54. * The application's route middleware.
  55. *
  56. * These middleware may be assigned to groups or used individually.
  57. *
  58. * @var array
  59. */
  60. protected $routeMiddleware = [
  61. 'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
  62. 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
  63. 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
  64. 'can' => \Illuminate\Auth\Middleware\Authorize::class,
  65. 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
  66. 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
  67. 'api.encrypt' => DataEncrypt::class
  68. ];
  69. }