| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public function handle(Request $request, Closure $next) |
||
| 19 | { |
||
| 20 | if (\I18n::routedLocale($request) === null) { |
||
| 21 | $negotiator = \I18n::getConfig('negotiator'); |
||
| 22 | $locale = app($negotiator)->preferredLocale($request); |
||
| 23 | |||
| 24 | return redirect(\I18n::url($request->getRequestUri(), $locale)); |
||
| 25 | } |
||
| 26 | |||
| 27 | return $next($request); |
||
| 28 | } |
||
| 29 | } |
||
| 30 |