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