AcceptsAjaxOnly::handle()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 3
1
<?php
2
3
namespace App\Http\Middleware;
4
5
class AcceptsAjaxOnly
6
{
7
    /**
8
     * Handle an incoming request.
9
     *
10
     * @param  \Illuminate\Http\Request  $request
11
     * @param  \Closure  $next
12
     * @param  string|null  $guard
13
     * @return mixed
14
     */
15
    public function handle($request, \Closure $next, $guard = null)
0 ignored issues
show
Unused Code introduced by
The parameter $guard is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
16
    {
17
        if($request->ajax())
18
            return $next($request);
19
20
        abort('404');
21
    }
22
}