Completed
Push — master ( 9448cf...a1463b )
by Scott
02:09
created

ApiMiddleware   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 9 2
1
<?php namespace Bedard\Shop\Classes;
2
3
use Bedard\Shop\Models\ApiSettings;
4
use Closure;
5
6
class ApiMiddleware
7
{
8
    public function handle($request, Closure $next)
9
    {
10
        if (! ApiSettings::isEnabled()) {
11
            abort(403, 'Forbidden');
12
            return;
13
        }
14
15
        return $next($request);
16
    }
17
}
18