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

ApiMiddleware::handle()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 9
c 1
b 0
f 0
rs 9.6666
cc 2
eloc 5
nc 2
nop 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