Skip to content

Commit

Permalink
fix: load routes and commands in the service provider's boot method (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
xel1045 authored May 4, 2022
1 parent b2d3907 commit e7c3f56
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 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,
DataFormatterInterface::class
Expand Down Expand Up @@ -90,8 +88,6 @@ public function register($engine, \Closure $resolver)
}
);

$this->commands(['command.debugbar.clear']);

Collection::macro('debug', function () {
debug($this);
return $this;
Expand All @@ -108,7 +104,13 @@ public function boot()
$configPath = __DIR__ . '/../config/debugbar.php';
$this->publishes([$configPath => $this->getConfigPath()], 'config');

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

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

if ($this->app->runningInConsole()) {
$this->commands(['command.debugbar.clear']);
}
}

/**
Expand Down

0 comments on commit e7c3f56

Please sign in to comment.