Skip to content

Commit

Permalink
add Install Command
Browse files Browse the repository at this point in the history
  • Loading branch information
atmonshi committed Sep 26, 2023
1 parent 1a0172d commit 4d70009
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
57 changes: 57 additions & 0 deletions src/Console/InstallCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php

namespace LaraZeus\Sky\Console;

use Illuminate\Console\Command;

class InstallCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'sky:install';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Install Sky components and resources';

/**
* Execute the console command.
*/
public function handle(): void
{
$this->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');
}
}
2 changes: 2 additions & 0 deletions src/SkyServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -42,6 +43,7 @@ protected function getCommands(): array
return [
migrateCommand::class,
PublishCommand::class,
InstallCommand::class,
];
}

Expand Down

0 comments on commit 4d70009

Please sign in to comment.