Print the route name and action in the response headers.
lukasss93/laravel-route-debug is a Laravel package for print the route name and action in the response headers..
It currently has 7 GitHub stars and 46.897 downloads on Packagist (latest version 3.1.0).
Install it with composer require lukasss93/laravel-route-debug.
Discover more Laravel packages by lukasss93
or browse all Laravel packages to compare alternatives.
Last updated

A simple package that prints the current route name and action in the Response Headers.
You can install the package using composer
composer require lukasss93/laravel-route-debug --dev
Then add the service provider to config/app.php.
This step can be skipped if package auto-discovery is enabled.
'providers' => [
Lukasss93\Laravel\RouteDebug\RouteDebugServiceProvider::class,
];
Publishing the config file is optional:
php artisan vendor:publish --provider="Lukasss93\Laravel\RouteDebug\RouteDebugServiceProvider" --tag="route-debug-config"
Enable the package turning on the APP_DEBUG environment variable or by setting the enabled config option to true.
Then, when you visit a page, you will see the route debuggers in the response headers.
The package will add the following headers to the response:
Laravel-Route-Name: The name of the current route.Laravel-Route-Action: The action of the current route.Laravel-Route-Can: The value of the can middleware of the current route.Laravel-Route-FormRequest: The FormRequest class of the current route action.You can disable any of these headers by commenting out the corresponding line in the config/route-debug.php file.
You can create a custom route debugger to add your own headers to the response.
Lukasss93\Laravel\RouteDebug\Contracts\RouteDebugger interface.handle method.config/route-debug.php file under the debuggers key.
composer test
| Package | L8.x | L9.x | L10.x | L11.x | L12.x | L13.x | |:-------:|:----:|:----:|:-----:|:-----:|:-----:|:-----:| | ^1.0 | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | | ^2.0 | ❌ | ❌ | ✅ | ✅ | ❌ | ❌ | | ^3.0 | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ |
| Package | PHP 7.4 | PHP 8.0 | PHP 8.1 | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 | |:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:| | ^1.0 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | ^2.0 | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | | ^3.0 | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ |
Please see the CHANGELOG.md for more information on what has changed recently.
Please see the LICENSE.md file for more information.