Completed
Push — master ( 8c3012...71bee6 )
by Faysal
01:12
created

AdminAuthenticate::redirectTo()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 1
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Devfaysal\LaravelAdmin\Http\Middleware;
4
5
use Illuminate\Auth\Middleware\Authenticate as Middleware;
6
7
class AdminAuthenticate 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
            return route('admins.login');
19
        }
20
        
21
    }
22
}
23