/** * Handle a navigation.main event second. * * @return void */ public function onNavigationMainThird() { // get the pages $pages = $this->pagerepository->navigation(); // select the home page $page = $pages[0]; // add the page to the start of the main nav bars $this->navigation->addToMain($page, 'default', true); $this->navigation->addToMain($page, 'admin', true); // add the view users link if ($this->credentials->check() && $this->credentials->hasAccess('mod')) { $this->navigation->addToMain(['title' => 'Users', 'slug' => 'users', 'icon' => 'user'], 'admin'); } }
/** * Add an item to the main navigation array. * * @param array $item * @param string $name * @param bool $first * @return $this * @static */ public static function addToMain($item, $name = 'default', $first = false) { return \GrahamCampbell\Navigation\Navigation::addToMain($item, $name, $first); }