PHPackages                             kodicomponents/navigation - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. kodicomponents/navigation

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

kodicomponents/navigation
=========================

The KodiCMS Support package.

v1.1(5y ago)12232.6k↓23.3%3[1 PRs](https://github.com/KodiComponents/Navigation/pulls)10MITPHPPHP &gt;=7.2.5

Since Mar 24Pushed 5y ago1 watchersCompare

[ Source](https://github.com/KodiComponents/Navigation)[ Packagist](https://packagist.org/packages/kodicomponents/navigation)[ Docs](http://kodicms.com)[ RSS](/packages/kodicomponents-navigation/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (19)Used By (10)

Laravel navigation class
========================

[](#laravel-navigation-class)

Installation
------------

[](#installation)

1. Require this package in your composer.json and run composer update:

    `composer require kodicomponents/navigation`
2. After composer update, insert service provider `KodiComponents\Navigation\NavigationServiceProvider::class,` before `Application Service Providers...` to the `config/app.php`

**Example**

```
	...
	/*
	 * Navigation Service Provider
	 */
	KodiComponents\Navigation\NavigationServiceProvider::class,

	/*
	 * Application Service Providers...
	 */
	App\Providers\AppServiceProvider::class,
	...
```

Using
-----

[](#using)

```
$navigation = new \KodiComponents\Navigation\Navigation([
	[
		'title' => 'Test',
		'icon' => 'fa fa-user',
		'priority' => 500,
		'url' => 'http://site.com',
		'pages' => [
			[
				'title' => 'Test3',
				'icon' => 'fa fa-user',
				'url' => 'http://site.com',
			],
		],
	],
	[
		'title' => 'Test1',
		'icon' => 'fa fa-user',
		'priority' => 600,
		'url' => 'http://site.com',
	],
]);

// Setting pages from array
$navigation->setFromArray([
	[
		'title' => 'Test',
		'icon' => 'fa fa-user',
		'priority' => 500,
		'url' => 'http://site.com',
		'pages' => [
			[
				'title' => 'Test3',
				'icon' => 'fa fa-user',
				'url' => 'http://site.com',
			],
		],
	],
	[
		'title' => 'Test1',
		'icon' => 'fa fa-user',
		'priority' => 600,
		'url' => 'http://site.com',
	],
]);

// Setting page with method addPage(array|string|\KodiComponents\Navigation\Contracts\PageInterface)

$newPage = $navigation->addPage('New page');
$subPage = $newPage->addPage('Sub page');

$subPage->setPages(function(PageInterface $page) {
	$page->addPage(...);
	$page->addPage(...);

	$page->addPage(...)->setPages(function(PageInterface $page) {
		...
	});
});

$page = new \KodiComponents\Navigation\Page();

$page->setTitle(...);
$page->setIcon(...);
$page->setId(...);

$subPage1 = $newPage->addPage($page);

$navigation->getPages()->push($page);

$navigation->getPages()->prepend($page);

// Child pages
$page->getPages(); // Get sub pages
$navigation->getPages(); // Navigation pages

// Count pages
$navigation->countPages();

// Get first page
$page = $navigation->getPages()->first();

// get sub pages
$page->getPages(); // return KodiComponents\Navigation\PageCollection

// Count sub pages
$page->countPages();

// get parent page
$page->getParent();

// check if page has child
$page->hasChild();
$page->isChildOf($navigation);

// get title
$page->getTitle();

// get icon
$page->getIcon();

// get id
$page->getId();

// get utl
$page->getUrl();

// get path
$page->getPath(); // return array ['first page title', 'second page title', 'current page']

// get priority
$page->getPriority();

// check is active
$page->isActive();

// to array
$navigation->toArray();
$page->toArray();
```

### Searching

[](#searching)

```
// by path
$navigation->getPages()->findByPath('Page 1/Page 2/Page 3');

// or for page
$page->getPages()->findByPath('Page 1/Page 2/Page 3');

// by id

$page = new \KodiComponents\Navigation\Page();
$page->setId('page_id');

$navigation->addPage($page);
$navigation->getPages()->findById('page_id'); // return Page | null

$subPage = $navigation->addPage('Test page without id');
$subPage->addPage('Test subpage without id');

$navigation->getPages()->findById(md5('Test page without id/Test subpage without id'));
```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity41

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 77.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~102 days

Recently: every ~299 days

Total

17

Last Release

2076d ago

Major Versions

v0.7.1 → v1.02020-03-19

PHP version history (2 changes)v0.0.1PHP &gt;=5.5.9

v1.0PHP &gt;=7.2.5

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/773481?v=4)[Pavel Buchnev](/maintainers/butschster)[@butschster](https://github.com/butschster)

---

Top Contributors

[![butschster](https://avatars.githubusercontent.com/u/773481?v=4)](https://github.com/butschster "butschster (28 commits)")[![daaner](https://avatars.githubusercontent.com/u/9641698?v=4)](https://github.com/daaner "daaner (7 commits)")[![ryankilf](https://avatars.githubusercontent.com/u/7476235?v=4)](https://github.com/ryankilf "ryankilf (1 commits)")

---

Tags

laravellaravel-5-packagelaravel-navigationmenunavigationlaravelmenunavigationkodicms

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kodicomponents-navigation/health.svg)

```
[![Health](https://phpackages.com/badges/kodicomponents-navigation/health.svg)](https://phpackages.com/packages/kodicomponents-navigation)
```

###  Alternatives

[caffeinated/menus

Laravel Menus

134159.5k5](/packages/caffeinated-menus)[akaunting/laravel-menu

Menu and sidebar management package for Laravel

38233.8k](/packages/akaunting-laravel-menu)[nedwors/navigator

A Laravel package to ease defining navigation menus

433.1k](/packages/nedwors-navigator)[rinvex/laravel-menus

Rinvex Menus is a simple menu builder package for Laravel, that supports hierarchical structure, ordering, and styling with full flexibility using presenters for easy styling and custom structure of menu rendering.

294.0k20](/packages/rinvex-laravel-menus)[nguyendachuy/laravel-menu

Laravel Menu Builder | Drag &amp; Drop | Bootstrap | Laravel 7 | Laravel 8 | Laravel 9 | Laravel 10 | Laravel 11 | Laravel 12

162.2k](/packages/nguyendachuy-laravel-menu)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
