Skip to content

Commit

Permalink
Merge pull request #129 from avored/avored-hotfix-472
Browse files Browse the repository at this point in the history
Bug fixed issue #472
  • Loading branch information
indpurvesh authored Sep 9, 2020
2 parents ae70834 + 6e91746 commit 5e92215
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/Support/Console/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace AvoRed\Framework\Support\Console;

use AvoRed\Framework\AvoRedProvider;
use AvoRed\Framework\Database\Contracts\ConfigurationModelInterface;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
Expand Down Expand Up @@ -45,6 +46,11 @@ class InstallCommand extends Command
* @var \AvoRed\Framework\Database\Repository\LanguageRepository
*/
protected $languageRepository;
/**
* Configuration Repository for the Install Command.
* @var \AvoRed\Framework\Database\Repository\LanguageRepository
*/
protected $configurationRepository;

/**
* Construct for the AvoRed install command.
Expand All @@ -53,19 +59,22 @@ class InstallCommand extends Command
* @param \AvoRed\Framework\Database\Contracts\LanguageModelInterface $languageRepository
* @param \AvoRed\Framework\Database\Contracts\UserGroupModelInterface $userGroupRepository
* @param \AvoRed\Framework\Database\Contracts\OrderStatusModelInterface $orderStatusRepository
* @param \AvoRed\Framework\Database\Contracts\ConfigurationModelInterface $configurationRepository
*/
public function __construct(
RoleModelInterface $roleRepository,
CurrencyModelInterface $currencyRepository,
LanguageModelInterface $languageRepository,
UserGroupModelInterface $userGroupRepository,
OrderStatusModelInterface $orderStatusRepository
OrderStatusModelInterface $orderStatusRepository,
ConfigurationModelInterface $configurationRepository
) {
$this->roleRepository = $roleRepository;
$this->currencyRepository = $currencyRepository;
$this->languageRepository = $languageRepository;
$this->userGroupRepository = $userGroupRepository;
$this->orderStatusRepository = $orderStatusRepository;
$this->configurationRepository = $configurationRepository;
parent::__construct();
}

Expand Down Expand Up @@ -123,7 +132,11 @@ public function createCurrency()
'conversation_rate' => 1,
'status' => 'ENABLED',
];
$this->currencyRepository->create($data);
$currency = $this->currencyRepository->create($data);
$this->configurationRepository->create([
'code' => 'default_currency',
'value' => $currency->id
]);
}

/**
Expand Down

0 comments on commit 5e92215

Please sign in to comment.