public function up()
 {
     /** @var Page $page */
     foreach (Page::all() as $page) {
         $page->view()->associate(View::create(['layout' => $page->layout]));
         $page->save();
     }
 }
Пример #2
0
 private function getView(Content $content, $layout)
 {
     if (!isset($content->value)) {
         $view = View::create(['layout' => $layout]);
         $content->value = $view->id;
         return $view;
     }
     return View::find($content->value);
 }