Conditions | 1 |
Paths | 1 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
12 | public function logRequest(Request $request) |
||
13 | { |
||
14 | $method = strtoupper($request->getMethod()); |
||
15 | |||
16 | $uri = $request->getPathInfo(); |
||
17 | |||
18 | $bodyAsJson = json_encode($request->except(config('http-logger.except'))); |
||
19 | |||
20 | $files = (new Collection(iterator_to_array($request->files))) |
||
21 | ->map([$this, 'flatFiles']) |
||
22 | ->flatten() |
||
23 | ->implode(',') |
||
24 | ; |
||
25 | $message = "{$method} {$uri} - Body: {$bodyAsJson} - Files: ". $files; |
||
26 | |||
27 | Log::info($message); |
||
28 | } |
||
29 | |||
41 |