public function run()
 {
     DB::table('pages')->delete();
     Page::create(['parent_id' => null, 'template_id' => 1, 'seo_id' => 1, 'nav_name' => 'Home', 'url' => 'home', 'title' => 'Home Page', 'sort' => 1, 'created_by' => 1]);
 }
示例#2
0
 /**
  * Returns a page and associated detail and template data
  * 
  * @param  string $slug
  * @return array
  */
 public function showBySlug($slug)
 {
     $data = Page::where(['url' => $slug])->with('template', 'detail.templateDetail')->firstOrFail();
     return $this->packagePage($data);
 }
 public function setUp()
 {
     parent::setUp();
     $this->model = Page::first();
 }