diff --git a/config/debugbar.php b/config/debugbar.php index fddfc34b3..179cdae9e 100644 --- a/config/debugbar.php +++ b/config/debugbar.php @@ -278,6 +278,15 @@ */ 'route_prefix' => '_debugbar', + /* + |-------------------------------------------------------------------------- + | DebugBar route middleware + |-------------------------------------------------------------------------- + | + | Additional middleware to run on the Debugbar routes + */ + 'route_middleware' => [], + /* |-------------------------------------------------------------------------- | DebugBar route domain diff --git a/src/debugbar-routes.php b/src/debugbar-routes.php index c8c87301f..9537e3d6d 100644 --- a/src/debugbar-routes.php +++ b/src/debugbar-routes.php @@ -4,7 +4,7 @@ 'namespace' => 'Barryvdh\Debugbar\Controllers', 'prefix' => app('config')->get('debugbar.route_prefix'), 'domain' => app('config')->get('debugbar.route_domain'), - 'middleware' => [\Barryvdh\Debugbar\Middleware\DebugbarEnabled::class], + 'middleware' => array_merge(app('config')->get('debugbar.route_middleware', []), [\Barryvdh\Debugbar\Middleware\DebugbarEnabled::class]), ]; app('router')->group($routeConfig, function ($router) {