mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-09 06:46:08 -06:00
#162 Creating Multiple cats once
This commit is contained in:
parent
78aa96b714
commit
f5809246ac
@ -108,18 +108,28 @@ class CategoryController extends AdminController
|
|||||||
array_push($isMultiCat, $firstArray);
|
array_push($isMultiCat, $firstArray);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for ($i = 0; $i < count($isMultiCat[0]); $i++) {
|
if (empty($isMultiCat)) {
|
||||||
foreach ($isMultiCat as $cat) {
|
$this->categoryRepository->create(array_merge($translatableEntries, [
|
||||||
$translatableEntries = array_merge($translatableEntries, $cat[$i]);
|
'slug' => $all['slug'],
|
||||||
}
|
|
||||||
$this->categoryRepository->create(array_merge($translatableEntries, [
|
|
||||||
'slug' => $this->str->slug(reset($translatableEntries)['name'], '_'),
|
|
||||||
'parent_category' => $all['parent_category'],
|
'parent_category' => $all['parent_category'],
|
||||||
'icon' => $all['icon'],
|
'icon' => $all['icon'],
|
||||||
'seo_keyword' => $all['seo_keyword'],
|
'seo_keyword' => $all['seo_keyword'],
|
||||||
'seo_description' => $all['seo_description'],
|
'seo_description' => $all['seo_description'],
|
||||||
]));
|
]));
|
||||||
}
|
} else {
|
||||||
|
for ($i = 0; $i < count($isMultiCat[0]); $i++) {
|
||||||
|
foreach ($isMultiCat as $cat) {
|
||||||
|
$translatableEntries = array_merge($translatableEntries, $cat[$i]);
|
||||||
|
}
|
||||||
|
$this->categoryRepository->create(array_merge($translatableEntries, [
|
||||||
|
'slug' => $this->str->slug(reset($translatableEntries)['name'], '_'),
|
||||||
|
'parent_category' => $all['parent_category'],
|
||||||
|
'icon' => $all['icon'],
|
||||||
|
'seo_keyword' => $all['seo_keyword'],
|
||||||
|
'seo_description' => $all['seo_description'],
|
||||||
|
]));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// $this->categoryRepository->create(array_merge($translatableEntries, [
|
// $this->categoryRepository->create(array_merge($translatableEntries, [
|
||||||
// 'slug' => $all['slug'],
|
// 'slug' => $all['slug'],
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user