IgnitionEnabled::ignitionEnabled()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Facade\Ignition\Http\Middleware;
4
5
use Closure;
6
use Illuminate\Http\Request;
7
8
class IgnitionEnabled
9
{
10
    /**
11
     * Handle an incoming request.
12
     *
13
     * @param  Request  $request
14
     * @param  Closure  $next
15
     * @return mixed
16
     */
17
    public function handle($request, Closure $next)
18
    {
19
        if (! $this->ignitionEnabled()) {
20
            abort(404);
21
        }
22
23
        return $next($request);
24
    }
25
26
    protected function ignitionEnabled(): bool
27
    {
28
        return config('app.debug');
29
    }
30
}
31