maximru/conditional-laravel-debugbar

允许有条件地启动 Laravel 调试栏,而不是使用 APP_DEBUG 和环境变量。你可以自由使用 \Auth::check(),自定义头信息,自定义参数,或任何你希望使用的东西

v0.13 2018-08-24 08:43 UTC

This package is auto-updated.

Last update: 2024-09-27 22:22:51 UTC


README

Scrutinizer Code Quality codecov StyleCI CircleCI

关于

允许在有条件的情况下启动 laravel-debugbar,而不是使用 APP_DEBUG 和环境变量。你可以自由使用 \Auth::check(),自定义头信息,自定义参数,或任何你希望使用的东西

安装

composer require maksimru/conditional-laravel-debugbar

用法

  1. 使用以下命令发布配置文件
php artisan vendor:publish
  1. 创建一个新的启动验证器,实现 \MaksimM\ConditionalDebugBar\Interfaces\DebugModeChecker 接口
  2. 在 debugbar-boot-validator 的 config/conditional-debugbar.php 中替换验证器类(详情请见提供的示例)
  3. 在你想使用调试栏的路由上添加 \MaksimM\ConditionalDebugBar\Http\Middleware\OptionalDebugBar::class 中间件

感谢 barryvdh 提供了出色的 barryvdh/laravel-debugbar