/** * Handle the command. * * @param PageRepositoryInterface $pages */ public function handle(PageRepositoryInterface $pages) { foreach ($this->page->getChildren() as $page) { if ($page instanceof PageInterface && $page->isEnabled()) { $pages->save($page->setAttribute('path', $this->page->getPath() . '/' . $page->getSlug())); } } }
/** * Handle the command. * * @param PageRepositoryInterface $pages */ public function handle(PageRepositoryInterface $pages) { /* @var PageInterface $page */ foreach ($this->page->getChildren() as $page) { if ($page->isEnabled()) { $pages->save($page->setPath($this->page->getPath() . '/' . $page->getSlug())); } } }
/** * Handle the command. * * @param PageRepositoryInterface $pages */ public function handle(PageRepositoryInterface $pages) { foreach ($this->page->getChildren() as $page) { $pages->delete($page); } }