Passed
Push — main ( 8a25dd...3c103b )
by TARIQ
12:48
created

Authenticate   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 12
c 0
b 0
f 0
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A redirectTo() 0 4 2
1
<?php
2
3
namespace App\Http\Middleware;
4
5
use Illuminate\Auth\Middleware\Authenticate as Middleware;
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|null
14
     */
15
    protected function redirectTo($request)
16
    {
17
        if (! $request->expectsJson()) {
18
            return route('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('login');
Loading history...
19
        }
20
    }
21
}
22