Hotfix: Adding countries to lunar install

This commit is contained in:
2026-07-10 12:38:48 +03:00
parent 2767a4bb69
commit c07b36e1f9
+8 -3
View File
@@ -22,19 +22,24 @@ use Lunar\Models\TaxZone;
/**
* Overrides Lunar's own lunar:install to skip the interactive prompts (migrate
* confirmation, admin creation, GitHub star), so it's safe to run unattended from
* the entrypoint on every boot. Migrations and address-data import already run as
* separate, earlier entrypoint steps; the admin user is created manually.
* the entrypoint on every boot. Migrations already run as a separate, earlier
* entrypoint step; the admin user is created manually.
*/
class InstallLunarCommand extends Command
{
protected $signature = 'lunar:install';
protected $description = 'Seed the default Lunar store data (channel, currency, tax zone, attributes, product type)';
protected $description = 'Seed the default Lunar store data (countries, channel, currency, tax zone, attributes, product type)';
public function handle(): void
{
$this->components->info('Seeding default Lunar store data...');
if (! Country::count()) {
$this->components->info('Importing countries');
$this->call('lunar:import:address-data');
}
DB::transaction(function () {
if (! Channel::whereDefault(true)->exists()) {
$this->components->info('Setting up default channel');