From 661117c9cb83a40e5c43e432cb5bc15e17f32106 Mon Sep 17 00:00:00 2001 From: Steve <34465153+xxl4@users.noreply.github.com> Date: Thu, 20 Jun 2024 14:00:29 +0800 Subject: [PATCH] add gendocs command --- src/Console/Commands/GenerateApiDocs.php | 38 ++++++++++++++++++++++++ src/Console/Commands/Install.php | 2 +- src/Providers/ApisServiceProvider.php | 1 + 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 src/Console/Commands/GenerateApiDocs.php diff --git a/src/Console/Commands/GenerateApiDocs.php b/src/Console/Commands/GenerateApiDocs.php new file mode 100644 index 0000000..10ee4de --- /dev/null +++ b/src/Console/Commands/GenerateApiDocs.php @@ -0,0 +1,38 @@ +info("Install app: Apis"); + if (!$this->confirm('Do you wish to continue?')) { + // ... + $this->error("App Apis Install cannelled"); + return false; + } + + $this->warn('Step: Generate l5-swagger docs (Admin & Shop)...'); + $result = shell_exec('php artisan l5-swagger:generate --all'); + $this->info($result); + + $this->comment('-----------------------------'); + $this->comment('Success: NexaMerchant REST API has been configured successfully.'); + } +} \ No newline at end of file diff --git a/src/Console/Commands/Install.php b/src/Console/Commands/Install.php index 2cbc097..9995aef 100644 --- a/src/Console/Commands/Install.php +++ b/src/Console/Commands/Install.php @@ -41,6 +41,6 @@ public function handle() $this->info($result); $this->comment('-----------------------------'); - $this->comment('Success: Bagisto REST API has been configured successfully.'); + $this->comment('Success: NexaMerchant REST API has been configured successfully.'); } } \ No newline at end of file diff --git a/src/Providers/ApisServiceProvider.php b/src/Providers/ApisServiceProvider.php index 38bd718..1f29211 100644 --- a/src/Providers/ApisServiceProvider.php +++ b/src/Providers/ApisServiceProvider.php @@ -112,6 +112,7 @@ protected function registerCommands(): void $this->commands([ \NexaMerchant\Apis\Console\Commands\Install::class, \NexaMerchant\Apis\Console\Commands\UnInstall::class, + \NexaMerchant\Apis\Console\Commands\GenerateApiDocs::class, ]); } }