From 52ca0217a4fccc2b3a15cdeeda7ec2ddde080a2a Mon Sep 17 00:00:00 2001 From: emmanuel Date: Mon, 22 Feb 2021 16:03:17 +0300 Subject: [PATCH] fixed the loaddata command --- src/Console/LoadData.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Console/LoadData.php b/src/Console/LoadData.php index 041edd3..f964cdf 100644 --- a/src/Console/LoadData.php +++ b/src/Console/LoadData.php @@ -32,6 +32,8 @@ public function handle() ]); + $this->call('migrate', []); + $this->loadDataFromApi(); $this->info('data loaded'); @@ -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);