예제 #1
0
 /**
  * @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]);
         }
     }
 }
예제 #2
0
 /**
  *
  */
 private function createMenuEntry()
 {
     if ($main = Menu::root()->where(['name' => 'Main'])->first()) {
         $main->children()->create(['name' => 'Gallery', 'url' => 'gallery', 'active' => true]);
     }
 }