1 | <?php |
||
2 | namespace App\Http\Middleware; |
||
3 | |||
4 | use Illuminate\Auth\Middleware\Authenticate as Middleware; |
||
5 | use Facades\App\Services\WhichPortal; |
||
6 | |||
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 | 1 | */ |
|
15 | protected function redirectTo($request) |
||
16 | 1 | { |
|
17 | if (WhichPortal::isManagerPortal()) { |
||
18 | return route('manager.login'); |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
19 | 1 | } elseif (WhichPortal::isHrPortal()) { |
|
20 | return route('hr_advisor.login'); |
||
21 | } else { |
||
22 | return route('login'); |
||
23 | } |
||
24 | } |
||
25 | } |
||
26 |