AcceptsAjaxOnly   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 7 2
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
}