Authenticate   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
wmc 3
eloc 7
c 0
b 0
f 0
dl 0
loc 16
ccs 3
cts 4
cp 0.75
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A redirectTo() 0 8 3
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
The function route was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

18
            return /** @scrutinizer ignore-call */ route('manager.login');
Loading history...
19 1
        } elseif (WhichPortal::isHrPortal()) {
20
            return route('hr_advisor.login');
21
        } else {
22
            return route('login');
23
        }
24
    }
25
}
26