Skip to content

Commit

Permalink
route_middleware from config (#1471)
Browse files Browse the repository at this point in the history
* route_middleware from config

* update config.php

* Update debugbar.php

---------

Co-authored-by: Barry vd. Heuvel <barryvdh@gmail.com>
  • Loading branch information
systemsolutionweb and barryvdh authored Feb 13, 2024
1 parent 088878b commit 60d3f5d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions config/debugbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,15 @@
*/
'route_prefix' => '_debugbar',

/*
|--------------------------------------------------------------------------
| DebugBar route middleware
|--------------------------------------------------------------------------
|
| Additional middleware to run on the Debugbar routes
*/
'route_middleware' => [],

/*
|--------------------------------------------------------------------------
| DebugBar route domain
Expand Down
2 changes: 1 addition & 1 deletion src/debugbar-routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 60d3f5d

Please sign in to comment.