From 4d700095204c089c2cdcb890a255b28b882e7187 Mon Sep 17 00:00:00 2001 From: Ash Monsh Date: Tue, 26 Sep 2023 07:29:51 +0300 Subject: [PATCH] add Install Command --- src/Console/InstallCommand.php | 57 ++++++++++++++++++++++++++++++++++ src/SkyServiceProvider.php | 2 ++ 2 files changed, 59 insertions(+) create mode 100644 src/Console/InstallCommand.php diff --git a/src/Console/InstallCommand.php b/src/Console/InstallCommand.php new file mode 100644 index 0000000..78ae357 --- /dev/null +++ b/src/Console/InstallCommand.php @@ -0,0 +1,57 @@ +info('publishing configuration...'); + + $this->callSilent('vendor:publish', ['--tag' => 'zeus-sky-config']); + + $this->info('publishing migrations...'); + + $this->callSilent('vendor:publish', ['--tag' => 'zeus-sky-migrations']); + + $this->callSilent('vendor:publish', [ + '--provider' => 'Spatie\Tags\TagsServiceProvider', + '--tag' => 'tags-migrations', + ]); + + $this->callSilent('vendor:publish', [ + '--provider' => 'Spatie\MediaLibrary\MediaLibraryServiceProvider', + '--tag' => 'migrations', + ]); + + $this->info('publishing zeus assets...'); + + $this->callSilent('vendor:publish', ['--tag' => 'zeus-config']); + $this->callSilent('vendor:publish', ['--tag' => 'zeus-assets']); + + $this->info('running migrations...'); + + $this->callSilent('migrate'); + + $this->output->success('Zeus and Sky has been Published successfully'); + } +} diff --git a/src/SkyServiceProvider.php b/src/SkyServiceProvider.php index 8070174..0daf73b 100644 --- a/src/SkyServiceProvider.php +++ b/src/SkyServiceProvider.php @@ -5,6 +5,7 @@ use Filament\Facades\Filament; use Filament\Forms\Components\Select; use LaraZeus\Core\CoreServiceProvider; +use LaraZeus\Sky\Console\InstallCommand; use LaraZeus\Sky\Console\migrateCommand; use LaraZeus\Sky\Console\PublishCommand; use RyanChandler\FilamentNavigation\Filament\Resources\NavigationResource; @@ -42,6 +43,7 @@ protected function getCommands(): array return [ migrateCommand::class, PublishCommand::class, + InstallCommand::class, ]; }