| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
- namespace App\Http;
- use Illuminate\Foundation\Http\Kernel as HttpKernel;
- /**
- * Http请求核心
- * @property array $middleware 全局中间件
- * @property array $middlewareGroups 中间分组
- * @property array $routeMiddleware 路由中间件
- *
- */
- class Kernel extends HttpKernel
- {
- /**
- * 全局HTTP中间件堆栈
- *
- * 这些中间件在应用程序的每个请求期间都会运行.
- *
- * @var array
- */
- protected $middleware = [
- // 获取应该信任的主机
- // \App\Http\Middleware\TrustHosts::class,
- // 关于设置信任代理有关的中间件
- //\App\Http\Middleware\TrustProxies::class,
- // 设置跨域请求 config/cors.php 可配置
- \Fruitcake\Cors\HandleCors::class,
- // post数据大小
- \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
- // 修剪字符串
- \App\Http\Middleware\TrimStrings::class,
- // 将空字符串字段转换为 null
- \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
- // 读取语言环境
- \App\Http\Middleware\LoadLocale::class,
- ];
- /**
- * 应用程序的路由中间件组
- *
- * 这些中间件在应用程序的每个路由分组请求期间都会运行.
- * @var array
- */
- protected $middlewareGroups = [
- 'api' => [
- // 动态路由绑定
- \Illuminate\Routing\Middleware\SubstituteBindings::class,
- // 先验证登录
- \App\Http\Middleware\Company\Login::class,
- ],
- ];
- /**
- * 应用程序的路由中间件
- *
- * 这些中间件可以分配给组或单独使用
- *
- * @var array
- */
- protected $routeMiddleware = [
-
- ];
- }
|