Nowadays in laravel 11, you can implement this in your bootstrap/app.php to do the same job:
->withExceptions(function (Exceptions $exceptions) { $exceptions->context(fn() => [ 'url' => request()->fullUrl(), ]); })