RegistrationEnabled   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 8 2
1
<?php
2
3
namespace Yajra\CMS\Http\Middleware;
4
5
use Closure;
6
7
class RegistrationEnabled
8
{
9
    /**
10
     * Handle an incoming request.
11
     *
12
     * @param  \Illuminate\Http\Request  $request
13
     * @param  \Closure  $next
14
     * @return mixed
15
     */
16
    public function handle($request, Closure $next)
17
    {
18
        if (! config('site.registration')) {
19
            abort(403, 'Registration is not allowed');
20
        }
21
22
        return $next($request);
23
    }
24
}
25