暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

APIVersion.php 428B

1234567891011121314151617181920212223
  1. <?php
  2. namespace App\Http\Middleware;
  3. use Closure;
  4. /**
  5. * Class APIVersion
  6. * @package App\Http\Middleware
  7. */
  8. class APIVersion
  9. {
  10. /**
  11. * Handle an incoming request.
  12. *
  13. * @param Request $request
  14. * @param Closure $next
  15. *
  16. * @return mixed
  17. */
  18. public function handle($request, Closure $next, $guard)
  19. {
  20. config(['app.api.version' => $guard]);
  21. return $next($request);
  22. }
  23. }