Skip to content

Commit f2fc84d

Browse files
committedMar 26, 2025·
add version console
1 parent 5ce004a commit f2fc84d

File tree

5 files changed

+31
-3
lines changed

5 files changed

+31
-3
lines changed
 

‎src/Console/Commands/Install.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Install extends CommandInterface
1212
protected $description = 'Publish L5SwaggerServiceProvider provider, view and config files.';
1313

1414
public function getAppVer() {
15-
return config("Apis.ver");
15+
return config("Apis.version");
1616
}
1717

1818
public function getAppName() {

‎src/Console/Commands/TestEmail.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class TestEmail extends CommandInterface {
1212
protected $description = 'Test email sending';
1313

1414
public function getAppVer() {
15-
return config("Apis.ver");
15+
return config("Apis.version");
1616
}
1717

1818
public function getAppName() {

‎src/Console/Commands/UnInstall.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class UnInstall extends CommandInterface
1111
protected $description = 'Uninstall Apis an app';
1212

1313
public function getAppVer() {
14-
return config("Apis.ver");
14+
return config("Apis.version");
1515
}
1616

1717
public function getAppName() {

‎src/Console/Commands/Version.php

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
namespace NexaMerchant\Apis\Console\Commands;
3+
use Illuminate\Support\Facades\Artisan;
4+
5+
use NexaMerchant\Apps\Console\Commands\CommandInterface;
6+
7+
class Version extends CommandInterface
8+
9+
{
10+
protected $signature = 'Apis:Version';
11+
12+
protected $description = 'Version of Apis';
13+
14+
public function getAppVer() {
15+
return config("Apis.version");
16+
}
17+
18+
public function getAppName() {
19+
return config("Apis.name");
20+
}
21+
22+
public function handle()
23+
{
24+
// read the version from the config file
25+
$this->info("Version: " . $this->getAppVer());
26+
}
27+
}

‎src/Providers/ApisServiceProvider.php

+1
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ protected function registerCommands(): void
120120
$this->commands([
121121
\NexaMerchant\Apis\Console\Commands\Install::class,
122122
\NexaMerchant\Apis\Console\Commands\UnInstall::class,
123+
\NexaMerchant\Apis\Console\Commands\Version::class,
123124
\NexaMerchant\Apis\Console\Commands\GenerateApiDocs::class,
124125
\NexaMerchant\Apis\Console\Commands\TestEmail::class,
125126
]);

0 commit comments

Comments
 (0)
Please sign in to comment.