Files
WMS/Modules/Countries/Console/SyncIsoCountriesCommand.php
T
2026-09-21 10:14:57 +01:00

37 lines
980 B
PHP
Executable File

<?php
namespace Modules\Countries\Console;
use Illuminate\Console\Command;
class SyncIsoCountriesCommand extends Command
{
/** @var string */
protected $signature = 'countries:sync-iso {--subdivisions : Also seed bundled ISO 3166-2 subdivision data}';
/** @var string */
protected $description = 'Synchronise bundled ISO 3166 country reference data.';
/**
* Execute the command.
*/
public function handle(): int
{
$this->call('db:seed', [
'--class' => 'Modules\\Countries\\Database\\Seeders\\IsoCountriesSeeder',
'--force' => true,
]);
if ($this->option('subdivisions')) {
$this->call('db:seed', [
'--class' => 'Modules\\Countries\\Database\\Seeders\\IsoCountrySubdivisionsSeeder',
'--force' => true,
]);
}
$this->components->info('ISO country reference data synchronised.');
return self::SUCCESS;
}
}