master
parent
eaa9d73e80
commit
14ce14820e
|
|
@ -118,35 +118,36 @@ class PagesTableSeeder extends Seeder
|
|||
'sub_type' => PageSubType::PUBLICATION_NEWS
|
||||
],
|
||||
'Медиа' => [
|
||||
// 'type' => PageType::PUBLICATIONS,
|
||||
// 'sub_type' => PageSubType::PUBLICATION_NEWS
|
||||
'children' => [
|
||||
'Фотогалерея' => [
|
||||
'type' => PageType::PUBLICATIONS,
|
||||
'sub_type' => PageSubType::PUBLICATION_PHOTOS
|
||||
],
|
||||
'Видеоархив' => [
|
||||
'type' => PageType::PUBLICATIONS,
|
||||
'sub_type' => PageSubType::PUBLICATION_VIDEO
|
||||
],
|
||||
]
|
||||
],
|
||||
// 'СМИ о нас' => [
|
||||
// 'type' => PageType::PUBLICATIONS,
|
||||
// 'sub_type' => PageSubType::PUBLICATION_SMI
|
||||
// ],
|
||||
// 'Фотогалерея' => [
|
||||
// 'type' => PageType::PUBLICATIONS,
|
||||
// 'sub_type' => PageSubType::PUBLICATION_PHOTOS
|
||||
// ],
|
||||
// 'Видеоархив' => [
|
||||
// 'type' => PageType::PUBLICATIONS,
|
||||
// 'sub_type' => PageSubType::PUBLICATION_VIDEO
|
||||
// ],
|
||||
'Контакты для СМИ' => [],
|
||||
]
|
||||
],
|
||||
'Контакты' => [
|
||||
'children' => [
|
||||
'Контактные данные' => [],
|
||||
'Как добраться' => [],
|
||||
'Консультации' => [],
|
||||
'Обратная связь' => [],
|
||||
]
|
||||
// 'children' => [
|
||||
// 'Контактные данные' => [],
|
||||
// 'Как добраться' => [],
|
||||
// 'Консультации' => [],
|
||||
// 'Обратная связь' => [],
|
||||
// ]
|
||||
]
|
||||
];
|
||||
|
||||
public function run() {
|
||||
public function run()
|
||||
{
|
||||
$ord = 0;
|
||||
collect($this->pages)->each(function ($data, $name) use (&$ord) {
|
||||
$data['ord'] = $ord++;
|
||||
|
|
@ -154,7 +155,8 @@ class PagesTableSeeder extends Seeder
|
|||
});
|
||||
}
|
||||
|
||||
public function importPage($name, $data, ?Page $parent = null) {
|
||||
public function importPage($name, $data, ?Page $parent = null)
|
||||
{
|
||||
$slug = Str::slug(Str::transliterate($name));
|
||||
$data += ['type' => $data['type'] ?? PageType::CONTENT, 'name' => $name];
|
||||
$page = Page::firstOrCreate(['parent_id' => $parent->id ?? 0, 'slug' => $slug]);
|
||||
|
|
|
|||
Loading…
Reference in New Issue