diff --git a/Console/Command/CategoriesCommand.php b/Console/Command/CategoriesCommand.php index c757cff..7aa1289 100644 --- a/Console/Command/CategoriesCommand.php +++ b/Console/Command/CategoriesCommand.php @@ -306,11 +306,10 @@ protected function addOrUpdateCategory($data, $isParent = false) protected function mapHeaders($row) { $headers = array_merge($this->requiredHeaders, $this->optionalHeaders, $this->additionalHeaders); + foreach ($row as $key => $item) { - foreach ($headers as $header) { - if($item == $header) { - $this->headersMap[$header] = $key; - } + if (in_array($item, $headers)) { + $this->headersMap[$item] = $key; } } }