/** * @internal param $generatedRecords */ private function createMenuEntry() { $records = \Modules\Page\Entities\Page::where('published', 1)->take(3)->get(); if ($main = Menu::root()->where(['name' => 'Main'])->first()) { foreach ($records as $element) { $main->children()->create(['name' => $element['title'], 'url' => "page/{$element['slug']}", 'active' => true]); } } }
/** * */ private function createMenuEntry() { if ($main = Menu::root()->where(['name' => 'Main'])->first()) { $main->children()->create(['name' => 'Gallery', 'url' => 'gallery', 'active' => true]); } }