Skip to content

Commit

Permalink
Revert "Move route definition into separate file (#1050)" (#1054)
Browse files Browse the repository at this point in the history
This reverts commit 971f70a.
  • Loading branch information
barryvdh authored Jun 27, 2020
1 parent 971f70a commit f015e1b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 42 deletions.
41 changes: 39 additions & 2 deletions src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ public function register()
{
$configPath = __DIR__ . '/../config/debugbar.php';
$this->mergeConfigFrom($configPath, 'debugbar');

$this->loadRoutesFrom(realpath(__DIR__.'/debugbar-routes.php'));

$this->app->alias(
DataFormatter::class,
Expand Down Expand Up @@ -68,6 +66,45 @@ public function boot()
$configPath = __DIR__ . '/../config/debugbar.php';
$this->publishes([$configPath => $this->getConfigPath()], 'config');

$routeConfig = [
'namespace' => 'Barryvdh\Debugbar\Controllers',
'prefix' => $this->app['config']->get('debugbar.route_prefix'),
'domain' => $this->app['config']->get('debugbar.route_domain'),
'middleware' => [DebugbarEnabled::class],
];

$this->getRouter()->group($routeConfig, function($router) {
$router->get('open', [
'uses' => 'OpenHandlerController@handle',
'as' => 'debugbar.openhandler',
]);

$router->get('clockwork/{id}', [
'uses' => 'OpenHandlerController@clockwork',
'as' => 'debugbar.clockwork',
]);

$router->get('telescope/{id}', [
'uses' => 'TelescopeController@show',
'as' => 'debugbar.telescope',
]);

$router->get('assets/stylesheets', [
'uses' => 'AssetController@css',
'as' => 'debugbar.assets.css',
]);

$router->get('assets/javascript', [
'uses' => 'AssetController@js',
'as' => 'debugbar.assets.js',
]);

$router->delete('cache/{key}/{tags?}', [
'uses' => 'CacheController@delete',
'as' => 'debugbar.cache.delete',
]);
});

$this->registerMiddleware(InjectDebugbar::class);
}

Expand Down
40 changes: 0 additions & 40 deletions src/debugbar-routes.php

This file was deleted.

0 comments on commit f015e1b

Please sign in to comment.