Passed
Push — feature/experience-skills-api ( 61a84a...f678ab )
by Tristan
07:17 queued 03:18
created

Authenticate   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 7
dl 0
loc 16
rs 10
c 0
b 0
f 0

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
     */
15
    protected function redirectTo($request)
16
    {
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
        } elseif (WhichPortal::isHrPortal()) {
20
            return route('hr_advisor.login');
21
        } else {
22
            return route('login');
23
        }
24
    }
25
}
26