| Conditions | 5 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | public function handle($request, Closure $next, $redirectToRoute = null) |
||
| 20 | { |
||
| 21 | $user = auth()->user(); |
||
| 22 | |||
| 23 | if (! $user || ($user instanceof MustVerifyMobile && ! $user->hasVerifiedMobile())) { |
||
| 24 | return $request->expectsJson() |
||
| 25 | ? abort(403, 'Your mobile number is not verified.') |
||
| 26 | : redirect('/')->withErrors(['mobile' => 'Your mobile number is not verified.']); |
||
| 27 | } |
||
| 28 | |||
| 29 | return $next($request); |
||
| 30 | } |
||
| 32 |