Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.x] Fix config bug. #54

Merged
merged 5 commits into from
Mar 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/Console/Commands/OrchestrateService.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

class OrchestrateService extends Command
{
use AsksQuestions,
GeneratesFiles;
use AsksQuestions;
use GeneratesFiles;

/**
* The name and signature of the console command.
Expand All @@ -38,7 +38,7 @@ class OrchestrateService extends Command

/**
* The driver to execute the new service.
*
*
* @var Payavel\Orchestration\ServiceDriver
*/
protected $driver;
Expand Down Expand Up @@ -98,7 +98,7 @@ protected function setProperties()
*
* @return void
*/
protected function generateService()
protected function generateService()
{
$studlyService = Str::studly($this->service->getId());

Expand Down Expand Up @@ -126,6 +126,10 @@ protected function generateService()

$this->driver::generateService($this->service, $this->providers, $this->merchants, $this->defaults);

if (file_exists($serviceConfig = config_path(Str::slug($this->service->getId()) . '.php'))) {
Config::set(Str::slug($this->service->getId()), require($serviceConfig));
}

$this->info('The ' . Str::lower($this->service->getName()) . ' config has been successfully generated.');
}

Expand All @@ -136,8 +140,6 @@ protected function generateService()
*/
protected function generateProviders()
{
$this->callSilently('config:clear');

$this->call("orchestrate:provider", ['--service' => $this->service->getId(), '--fake' => true]);

$this->providers->each(
Expand Down
Loading