/** * Handle the command. */ public function handle(ViewTemplate $template) { /* @var PageInterface $page */ if (!($page = $template->get('page'))) { return; } /* @var PageInterface $current */ $current = $this->pages->find($page->getId()); $current->setCurrent(true); }
/** * Handle the command. */ public function handle() { /* @var PageInterface|EloquentModel $page */ foreach ($this->pages as $page) { /* @var PageInterface $parent */ if (($id = $page->getParentId()) && ($parent = $this->pages->find($id))) { $page->setRelation('parent', $parent); } } }