Skip to content

Commit 60d3f5d

Browse files
route_middleware from config (#1471)
* route_middleware from config * update config.php * Update debugbar.php --------- Co-authored-by: Barry vd. Heuvel <[email protected]>
1 parent 088878b commit 60d3f5d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

config/debugbar.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,15 @@
278278
*/
279279
'route_prefix' => '_debugbar',
280280

281+
/*
282+
|--------------------------------------------------------------------------
283+
| DebugBar route middleware
284+
|--------------------------------------------------------------------------
285+
|
286+
| Additional middleware to run on the Debugbar routes
287+
*/
288+
'route_middleware' => [],
289+
281290
/*
282291
|--------------------------------------------------------------------------
283292
| DebugBar route domain

src/debugbar-routes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
'namespace' => 'Barryvdh\Debugbar\Controllers',
55
'prefix' => app('config')->get('debugbar.route_prefix'),
66
'domain' => app('config')->get('debugbar.route_domain'),
7-
'middleware' => [\Barryvdh\Debugbar\Middleware\DebugbarEnabled::class],
7+
'middleware' => array_merge(app('config')->get('debugbar.route_middleware', []), [\Barryvdh\Debugbar\Middleware\DebugbarEnabled::class]),
88
];
99

1010
app('router')->group($routeConfig, function ($router) {

0 commit comments

Comments
 (0)