Skip to content

Commit

Permalink
Move booting of commands (#1034)
Browse files Browse the repository at this point in the history
  • Loading branch information
driesvints authored Mar 16, 2021
1 parent bae10e7 commit cb39fdc
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions src/TelescopeServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public function boot()
$this->registerRoutes();
$this->registerMigrations();
$this->registerPublishing();
$this->registerCommands();

Telescope::start($this->app);
Telescope::listenForStorageOpportunities($this->app);
Expand Down Expand Up @@ -101,6 +102,23 @@ private function registerPublishing()
}
}

/**
* Register the package's commands.
*
* @return void
*/
protected function registerCommands()
{
if ($this->app->runningInConsole()) {
$this->commands([
Console\ClearCommand::class,
Console\InstallCommand::class,
Console\PruneCommand::class,
Console\PublishCommand::class,
]);
}
}

/**
* Register any package services.
*
Expand All @@ -113,13 +131,6 @@ public function register()
);

$this->registerStorageDriver();

$this->commands([
Console\ClearCommand::class,
Console\InstallCommand::class,
Console\PruneCommand::class,
Console\PublishCommand::class,
]);
}

/**
Expand Down

0 comments on commit cb39fdc

Please sign in to comment.