We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 2b3dec8 + ee4e957 commit ac91a49Copy full SHA for ac91a49
src/Observers/RequestLogObserver.php
@@ -11,5 +11,21 @@ public function saving(RequestLogBaseModel $model)
11
if (null === $model->occurred_at) {
12
$model->occurred_at = now();
13
}
14
+
15
+ $model->body = $this->parsePossibleJson($model->body);
16
+ $model->response = $this->parsePossibleJson($model->response);
17
+ }
18
19
+ protected function parsePossibleJson(null|array|string|object $possibleJson) : null|array|string|object
20
+ {
21
+ while (
22
+ is_string($possibleJson)
23
+ && ! empty($possibleJson)
24
+ && ($parsed_json = json_decode($possibleJson, true)) !== null
25
+ ) {
26
+ $possibleJson = $parsed_json;
27
28
29
+ return $possibleJson;
30
31
0 commit comments