Код: Выделить всё
class Logger
{
public function handle($request, Closure $next)
{
return $next($request);
}
public function terminate($request, $response)
{
Log::info('ApiLog done===========================');
Log::info('URL: ' . $request->fullUrl());
Log::info('Method: ' . $request->getMethod());
Log::info('IP Address: ' . $request->getClientIp());
Log::info("Data: ",[$request->all()]);
// Log::info("Query String: ", [$request->query()]);
Log::info("Response".$response->getContent());
}
}
Сначала я пытаюсь использовать дескриптор только при обработке запроса и получаю ответ, а затем записываю его, используя
р>
Код: Выделить всё
public function handle($request, Closure $next)
{
$response = $next($request);
Log::response("",[$response])
return $response;
}
Можете ли вы мне помочь получить тело ответа?
Подробнее здесь: https://stackoverflow.com/questions/526 ... middleware