Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Log all request to Laravel app. Based on updated for Laravel 5.3
namespace App\Http\Middleware;
use Illuminate\Support\Facades\Log;
class LogAfterRequest {
public function handle($request, \Closure $next)
return $next($request);
public function terminate($request, $response)
Log::info('app.requests', ['request' => $request->all(), 'response' => $response]);
Copy link

GabrieleCicconetti commented Sep 15, 2020

Thank you this is incredibly usefull ❤️

Copy link

cp-vrkansagara commented Sep 15, 2020

Copy link

salmagomaa commented Jun 9, 2021

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment