Introduction
Sometimes when developing a new site or application in Laravel you need to log exactly the route calls in order to track bugs and errors. This operation is straightforward.
First, let’s create a new Middleware
php artisan make:middleware LogRouteMiddleware
Then edit the handle
function like the following:
<?php
public function handle($request, Closure $next)
{
Log::info($request->fullUrl());
return $next($request);
}
The fullUrl
method logs the full …