Changeset View
Changeset View
Standalone View
Standalone View
src/app/Console/Commands/Data/ImportCommand.php
- This file was added.
<?php | |||||
namespace App\Console\Commands\Data; | |||||
use Illuminate\Console\Command; | |||||
class ImportCommand extends Command | |||||
{ | |||||
/** | |||||
* The name and signature of the console command. | |||||
* | |||||
* @var string | |||||
*/ | |||||
protected $signature = 'data:import'; | |||||
/** | |||||
* The console command description. | |||||
* | |||||
* @var string | |||||
*/ | |||||
protected $description = 'Import data from external sources'; | |||||
/** | |||||
* Execute the console command. | |||||
* | |||||
* @return int | |||||
*/ | |||||
public function handle() | |||||
{ | |||||
$commands = [ | |||||
Import\CountriesCommand::class | |||||
]; | |||||
foreach ($commands as $command) { | |||||
$execution = new $command(); | |||||
$execution->output = $this->output; | |||||
$execution->handle(); | |||||
} | |||||
} | |||||
} |