for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php namespace Anomaly\Streams\Platform\Ui\ControlPanel\Component\Navigation;
use Anomaly\Streams\Platform\Support\Collection;
use Anomaly\Streams\Platform\Ui\ControlPanel\Component\Navigation\Contract\NavigationLinkInterface;
/**
* Class NavigationCollection
*
* @link http://pyrocms.com/
* @author PyroCMS, Inc. <[email protected]>
* @author Ryan Thompson <[email protected]>
*/
class NavigationCollection extends Collection
{
* Return the active link.
* @return null|NavigationLinkInterface
public function active()
/* @var NavigationLinkInterface $item */
foreach ($this->items as $item) {
if ($item->isActive()) {
return $item;
}
return null;
* Get a navigation link.
* @param mixed $key
* @param null $default
* @return NavigationLinkInterface
public function get($key, $default = null)
if ($item->getSlug() == $key) {
return $default ? $this->get($default) : null;
* Get landing page
* @return NavigationLink
public function home()
return $this->get('anomaly.module.dashboard');