RedirectIfAuthenticated   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 8 2
1
<?php
2
3
namespace App\Http\Middleware;
4
5
use Closure;
6
7
class RedirectIfAuthenticated
8
{
9
    public function handle($request, Closure $next)
10
    {
11
        if (current_user()) {
12
            return redirect()->to(current_user()->getHomeUrl());
13
        }
14
15
        return $next($request);
16
    }
17
}
18