| Total Complexity | 6 |
| Total Lines | 17 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class Authenticate extends Middleware |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Get the path the user should be redirected to when they are not authenticated. |
||
| 11 | * |
||
| 12 | * @param \Illuminate\Http\Request $request |
||
| 13 | * @return string |
||
| 14 | */ |
||
| 15 | protected function redirectTo($request) |
||
| 16 | { |
||
| 17 | if (! $request->expectsJson()) { |
||
| 18 | if($request->is('admin') || $request->is('admin/*')) { |
||
| 19 | return route('admin.login'); |
||
| 20 | } else if($request->is('doctor') || $request->is('doctor/*')) { |
||
| 21 | return route('doctor.login'); |
||
| 22 | } else { |
||
| 23 | return route('login'); |
||
| 24 | } |
||
| 28 |