Skip to content

Commit 2e3c326

Browse files
committed
Merge branch 'master' of github.com:zonneplan/laravel-module-loader
2 parents 46d7bf4 + 4ce9da1 commit 2e3c326

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Module.php

+6-4
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ public function register(): void
4747
{
4848
// Register this module in the repository
4949
app(ModuleRepositoryContract::class)->register($this->getModuleNamespace(), $this->getModulePath());
50-
51-
$this->registerCommands();
5250
}
5351

5452
/**
@@ -60,8 +58,12 @@ public function register(): void
6058
*/
6159
public function boot(): void
6260
{
63-
$this->loadCommandSchedule();
64-
$this->loadMigrations();
61+
if ($this->app->runningInConsole()) {
62+
$this->registerCommands();
63+
$this->loadCommandSchedule();
64+
$this->loadMigrations();
65+
}
66+
6567
$this->loadViews();
6668
$this->loadTranslations();
6769
$this->loadConfigs();

0 commit comments

Comments
 (0)