8000 Only register internal artisan commands when NativePHP is running · Dheia/laravel-NativePHP@6a43575 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6a43575

Browse files
committed
Only register internal artisan commands when NativePHP is running
1 parent 2e7ed53 commit 6a43575

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/NativeServiceProvider.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Native\Laravel;
44

5+
use Illuminate\Console\Application as Artisan;
56
use Illuminate\Support\Arr;
67
use Native\Laravel\Commands\LoadPHPConfigurationCommand;
78
use Native\Laravel\Commands\LoadStartupConfigurationCommand;
@@ -19,9 +20,6 @@ public function configurePackage(Package $package): void
1920
->name('nativephp')
2021
->hasCommands([
2122
MigrateCommand::class,
22-
MinifyApplicationCommand::class,
23-
LoadStartupConfigurationCommand::class,
24-
LoadPHPConfigurationCommand::class,
2523
])
2624
->hasConfigFile()
2725
->hasRoute('api')
@@ -37,6 +35,14 @@ public function packageRegistered()
3735
});
3836

3937
if (config('nativephp-internal.running')) {
38+
Artisan::starting(function ($artisan) {
39+
$artisan->resolveCommands([
40+
MinifyApplicationCommand::class,
41+
LoadStartupConfigurationCommand::class,
42+
LoadPHPConfigurationCommand::class,
43+
]);
44+
});
45+
4046
$this->configureApp();
4147
}
4248
}

0 commit comments

Comments
 (0)
0