/** * Run the seeder. */ public function run() { $this->posts->truncate(); $repository = new EntryRepository(); $repository->setModel(new PostsDefaultPostsEntryModel()); $repository->truncate(); $type = $this->types->findBySlug('default'); $category = $this->categories->findBySlug('news'); $welcome = (new PostsDefaultPostsEntryModel())->create(['content' => '<p>Welcome to PyroCMS!</p>']); $this->posts->create(['en' => ['title' => 'Welcome to PyroCMS!', 'summary' => 'This is an example post to demonstrate the posts module.'], 'slug' => 'welcome-to-pyrocms', 'publish_at' => time(), 'enabled' => true, 'type' => $type, 'entry' => $welcome, 'category' => $category, 'author' => 1]); }
/** * Run the seeder. */ public function run() { $repository = new EntryRepository(); $repository->setModel(new UrlLinkTypeModel()); $repository->truncate(); $menu = $this->menus->findBySlug('footer'); $pyrocms = $repository->create(['en' => ['title' => 'PyroCMS.com'], 'url' => 'http://pyrocms.com/']); $documentation = $repository->create(['en' => ['title' => 'Documentation'], 'url' => 'http://pyrocms.com/documentation']); $this->links->truncate(); $this->links->create(['menu' => $menu, 'target' => '_blank', 'entry' => $pyrocms, 'type' => 'anomaly.extension.url_link_type']); $this->links->create(['menu' => $menu, 'target' => '_blank', 'entry' => $documentation, 'type' => 'anomaly.extension.url_link_type']); }