diff --git a/src/Console/Commands/UiPublishCommand.php b/src/Console/Commands/UiPublishCommand.php index d7e6bc8..1977c18 100644 --- a/src/Console/Commands/UiPublishCommand.php +++ b/src/Console/Commands/UiPublishCommand.php @@ -8,12 +8,16 @@ class UiPublishCommand extends Command { protected $signature = 'admix:ui-publish'; - protected $description = 'Publica os arquivos do admix-ui em public/vendor/admix-ui'; + protected $description = 'Publica os arquivos do admix-ui em public/vendor/admix-ui '; public function handle(): int { $this->line(''); - $this->components->error('Implementar / Olhar o admix:install'); + $this->components->info('Publicando os arquivos do admix'); + + $this->callSilent('vendor:publish', ['--tag' => 'admix-ui:assets', '--force' => true]); + + $this->components->info('Arquivos publicados com sucesso.'); return static::SUCCESS; } diff --git a/src/Providers/UiServiceProvider.php b/src/Providers/UiServiceProvider.php index 6649e0e..495f504 100755 --- a/src/Providers/UiServiceProvider.php +++ b/src/Providers/UiServiceProvider.php @@ -9,6 +9,7 @@ class UiServiceProvider extends ServiceProvider public function boot(): void { $this->bootProviders(); + $this->publish(); } public function register(): void @@ -22,4 +23,11 @@ public function bootProviders(): void $this->app->register(CommandServiceProvider::class); $this->app->register(RouteServiceProvider::class); } + + private function publish(): void + { + $this->publishes([ + __DIR__ . '/../../tabler' => public_path('vendor/admix-ui/tabler'), + ], 'admix-ui:assets'); + } }