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\Ui\ControlPanel\ControlPanelBuilder;
/**
* Class NavigationSorter
*
* @link http://pyrocms.com/
* @author PyroCMS, Inc. <[email protected]>
* @author Ryan Thompson <[email protected]>
*/
class NavigationSorter
{
* Create a new NavigationSorter instance.
* @param ControlPanelBuilder $builder
public function sort(ControlPanelBuilder $builder)
$navigation = $builder->getNavigation();
ksort($navigation);
foreach ($navigation as $key => $module) {
if ($key == 'dashboard') {
$navigation = [$key => $module] + $navigation;
break;
}
$builder->setNavigation($navigation);