Conditions | 8 |
Paths | 5 |
Total Lines | 32 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 14 |
CRAP Score | 8.0189 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | 700 | public function handle($request, Closure $next) |
|
24 | { |
||
25 | 700 | if(config('logging.channels.daily.level') === 'debug') |
|
26 | { |
||
27 | 700 | $user = isset(Auth::user()->user_id) ? Auth::user()->full_name : \Request::ip(); |
|
28 | 700 | $requestData = $request->request->all(); |
|
29 | |||
30 | 700 | Log::debug('Route '.Route::currentRouteName().' visited by '.$user); |
|
31 | |||
32 | 700 | if(!empty($requestData)) |
|
33 | { |
||
34 | 328 | foreach($this->redact as $i) |
|
35 | { |
||
36 | 328 | if(Arr::exists($requestData, $i)) |
|
37 | { |
||
38 | 44 | $requestData[$i] = '[REDACTED]'; |
|
39 | } |
||
40 | } |
||
41 | 328 | foreach($this->ignore as $i) |
|
42 | { |
||
43 | 328 | if(Arr::exists($requestData, $i)) |
|
44 | { |
||
45 | 8 | unset($requestData[$i]); |
|
46 | } |
||
47 | } |
||
48 | 328 | Log::debug('Submitted Data ', $requestData); |
|
49 | } |
||
50 | |||
51 | 700 | return $next($request); |
|
52 | } |
||
53 | |||
54 | return $next($request); |
||
55 | } |
||
57 |