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