lukasss93/laravel-route-debug
最新稳定版本:3.0.0
Composer 安装命令:
composer require lukasss93/laravel-route-debug
包简介
Print the route name and action in the response headers.
README 文档
README
Laravel Route Debug
A simple package that prints the current route name and action in the Response Headers.
🚀 Installation
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
Publishing the config file is optional:
php artisan vendor:publish --provider="Lukasss93\Laravel\RouteDebug\RouteDebugServiceProvider" --tag="route-debug-config"
👓 Usage
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.
Route Debuggers
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 thecanmiddleware 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.
Custom Route Debugger
You can create a custom route debugger to add your own headers to the response.
- Create a new class that implements the
Lukasss93\Laravel\RouteDebug\Contracts\RouteDebuggerinterface. - Add your custom logic to the
handlemethod. - Register your custom route debugger in the
config/route-debug.phpfile under thedebuggerskey.
Screenshot
⚗️ Testing
composer test
🔰 Version Support
| Package | L8.x | L9.x | L10.x | L11.x | L12.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 |
|---|---|---|---|---|---|---|
| ^1.0 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| ^2.0 | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ |
| ^3.0 | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ |
📃 Changelog
Please see the CHANGELOG.md for more information on what has changed recently.
🏅 Credits
📖 License
Please see the LICENSE.md file for more information.
统计信息
- 总下载量: 22.96k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-02-01