| Conditions | 4 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 4.1755 |
| Changes | 0 | ||
| 1 | <?php namespace App\Http\Controllers; |
||
| 13 | 3 | public function index(Request $request) |
|
| 14 | { |
||
| 15 | 3 | if (app('translator')->getLocale() == config('app.locale') && app('translator')->getLocale() != $request->segment(1)) { |
|
| 16 | 1 | return redirect(app('translator')->getLocale()); |
|
| 17 | } |
||
| 18 | |||
| 19 | 3 | $name = trans('auth.guest'); |
|
| 20 | 3 | $userType = self::TRANSLATION_TAG_GUEST_USER; |
|
| 21 | |||
| 22 | /** @var \App\Models\User $user */ |
||
| 23 | 3 | if ($user = app('auth.driver')->user()) { |
|
| 24 | $name = $user->name; |
||
| 25 | $userType = self::TRANSLATION_TAG_REGISTERED_USER; |
||
| 26 | } |
||
| 27 | |||
| 28 | 3 | return view('index', ['userType' => $userType, 'name' => $name]); |
|
| 29 | } |
||
| 30 | } |
||
| 31 |