Skip to content

Commit

Permalink
fixed the loaddata command
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrax committed Feb 22, 2021
1 parent cafb039 commit 52ca021
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Console/LoadData.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public function handle()

]);

$this->call('migrate', []);

$this->loadDataFromApi();

$this->info('data loaded');
Expand All @@ -44,7 +46,7 @@ public function loadDataFromApi()

$country = new Country();

foreach ($reponse as $nation) {
foreach ($reponse->result as $nation) {
$country->name = $nation->name;
$country->code = $nation->code;
$country->state = json_encode($nation->states);
Expand Down

0 comments on commit 52ca021

Please sign in to comment.