Skip to content

Commit

Permalink
Fix to have the resources queries logged
Browse files Browse the repository at this point in the history
  • Loading branch information
promatik committed Sep 4, 2023
1 parent a3d9fd7 commit f78fa03
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/app/Helpers/CommonHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ function json_response(mixed $data = null, int $code = 0, int $status = 200, mix
'errors' => $errors,
];

$result = json_encode($response);

if (debugMode()) {
$time = (int) ((microtime(true) - LARAVEL_START) * 1e6);
$timeData = $time > 1e6 ? [$time / 1e6, 's'] : (
Expand Down Expand Up @@ -196,13 +198,13 @@ function json_response(mixed $data = null, int $code = 0, int $status = 200, mix
],
'post' => request()->request->all(),
]]);
}

$response = json_encode($response);
$result = json_encode($response);
}

return response($response, $status)
return response($result, $status)
->header('Content-Type', 'text/json')
->header('Content-Length', strval(strlen($response)));
->header('Content-Length', strval(strlen($result)));
}
}

Expand Down Expand Up @@ -300,7 +302,7 @@ function __construct(

function __call($method, $params)
{
$this->memo[$this->target]??=[];
$this->memo[$this->target] ??= [];

$signature = $method.crc32(json_encode($params));

Expand Down

0 comments on commit f78fa03

Please sign in to comment.