-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
29b2bf8
commit 3c16452
Showing
4 changed files
with
125 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php namespace Arcanesoft\Settings\Console; | ||
|
||
use Arcanedev\Support\Bases\Command; | ||
|
||
/** | ||
* Class PublishCommand | ||
* | ||
* @package Arcanesoft\Auth\Console | ||
* @author ARCANEDEV <[email protected]> | ||
*/ | ||
class PublishCommand extends Command | ||
{ | ||
/* ------------------------------------------------------------------------------------------------ | ||
| Properties | ||
| ------------------------------------------------------------------------------------------------ | ||
*/ | ||
/** | ||
* The name and signature of the console command. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = 'settings:publish'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Publish settings config, migrations.'; | ||
|
||
/* ------------------------------------------------------------------------------------------------ | ||
| Main Functions | ||
| ------------------------------------------------------------------------------------------------ | ||
*/ | ||
/** | ||
* Execute the console command. | ||
*/ | ||
public function handle() | ||
{ | ||
$this->call('vendor:publish', [ | ||
'--provider' => \Arcanesoft\Settings\SettingsServiceProvider::class, | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php namespace Arcanesoft\Settings\Providers; | ||
|
||
use Arcanedev\Support\Providers\CommandServiceProvider as ServiceProvider; | ||
|
||
/** | ||
* Class CommandServiceProvider | ||
* | ||
* @package Arcanesoft\Settings\Providers | ||
* @author ARCANEDEV <[email protected]> | ||
*/ | ||
class CommandServiceProvider extends ServiceProvider | ||
{ | ||
/* ------------------------------------------------------------------------------------------------ | ||
| Main Functions | ||
| ------------------------------------------------------------------------------------------------ | ||
*/ | ||
/** | ||
* Register the service provider. | ||
*/ | ||
public function register() | ||
{ | ||
$this->registerPublishCommand(); | ||
|
||
$this->commands($this->commands); | ||
} | ||
|
||
/** | ||
* Get the provided commands. | ||
* | ||
* @return array | ||
*/ | ||
public function provides() | ||
{ | ||
return [ | ||
'arcanesoft.settings.commands.publish', | ||
]; | ||
} | ||
|
||
/* ------------------------------------------------------------------------------------------------ | ||
| Command Functions | ||
| ------------------------------------------------------------------------------------------------ | ||
*/ | ||
/** | ||
* Register the publish command. | ||
*/ | ||
private function registerPublishCommand() | ||
{ | ||
$this->app->singleton( | ||
'arcanesoft.settings.commands.publish', | ||
\Arcanesoft\Settings\Console\PublishCommand::class | ||
); | ||
|
||
$this->commands[] = \Arcanesoft\Settings\Console\PublishCommand::class; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php namespace Arcanesoft\Settings\Tests\Console; | ||
|
||
use Arcanesoft\Settings\Tests\TestCase; | ||
|
||
/** | ||
* Class PublishCommandTest | ||
* | ||
* @package Arcanesoft\Auth\Tests\Console | ||
* @author ARCANEDEV <[email protected]> | ||
*/ | ||
class PublishCommandTest extends TestCase | ||
{ | ||
/* ------------------------------------------------------------------------------------------------ | ||
| Test Functions | ||
| ------------------------------------------------------------------------------------------------ | ||
*/ | ||
/** @test */ | ||
public function it_can_publish() | ||
{ | ||
$this->assertEquals(0, $this->artisan('settings:publish')); | ||
} | ||
} |