Passed
Push — develop ( d2ded6...15ac65 )
by Nikita
19:39
created

AdminMiddleware   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
dl 0
loc 16
ccs 4
cts 4
cp 1
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 7 2
1
<?php
2
3
namespace Gameap\Http\Middleware;
4
5
use Closure;
6
use Illuminate\Support\Facades\Auth;
7
use Bouncer;
8
9
class AdminMiddleware
10
{
11
    /**
12
     * Handle an incoming request.
13
     *
14
     * @param  \Illuminate\Http\Request  $request
15
     * @param  \Closure  $next
16
     * @return mixed
17
     */
18 9
    public function handle($request, Closure $next)
19
    {
20 9
        if (!Bouncer::can('admin roles & permissions')) {
21 6
            abort('403', 'Access Denied');
22
        }
23
24 3
        return $next($request);
25
    }
26
}
27