Completed
Push — main ( 72e6f8...077cf1 )
by mohsen
15s queued 14s
created

CheckAccessToMonitoringPanel   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
dl 0
loc 11
c 1
b 0
f 0
rs 10
wmc 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 9 4
1
<?php
2
3
namespace MohsenAbrishami\Stethoscope\Http\Middleware;
4
5
use Closure;
6
7
class CheckAccessToMonitoringPanel
8
{
9
    public function handle($request, Closure $next)
10
    {
11
        if (!config('stethoscope.monitoring_panel_status'))
12
            abort(404);
13
14
        if (config('stethoscope.monitoring_panel_key') && request()->get('key') != config('stethoscope.monitoring_panel_key'))
15
            abort(404);
16
17
        return $next($request);
18
    }
19
}
20