PHPackages                             felixdorn/laravel-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. felixdorn/laravel-navigation

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

felixdorn/laravel-navigation
============================

Create navigation menus for your Laravel application.

1.0.0(3y ago)052[4 PRs](https://github.com/felixdorn/laravel-navigation/pulls)MITPHPPHP ^8.1

Since May 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/felixdorn/laravel-navigation)[ Packagist](https://packagist.org/packages/felixdorn/laravel-navigation)[ Docs](https://github.com/honda/navigation)[ RSS](/packages/felixdorn-laravel-navigation/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (9)Versions (11)Used By (0)

Navigation for Laravel
======================

[](#navigation-for-laravel)

Create navigation menus for your Laravel application, works out of the box with Inertia.

Features
--------

[](#features)

- Inertia support
- Conditionally add sections / items.
- Easily specify if a route is active
- Add metadata to items

[![Tests](https://github.com/felixdorn/laravel-navigation/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/felixdorn/laravel-navigation/actions/workflows/tests.yml)[![Formats](https://github.com/felixdorn/laravel-navigation/actions/workflows/formats.yml/badge.svg?branch=main)](https://github.com/felixdorn/laravel-navigation/actions/workflows/formats.yml)[![Version](https://camo.githubusercontent.com/5c957dfce57fdf46a3167dafa592c7c8235f35933fee5fb54b765c10cd4dc23d/68747470733a2f2f706f7365722e707567782e6f72672f66656c6978646f726e2f6c61726176656c2d6e617669676174696f6e2f76657273696f6e)](//packagist.org/packages/felixdorn/laravel-navigation)[![Total Downloads](https://camo.githubusercontent.com/43d35c6bbc00bede6886fb5bb8feb1d5702aeaafbf4cd6b4242a1281acc03e89/68747470733a2f2f706f7365722e707567782e6f72672f686f6e64612f6e617669676174696f6e2f646f776e6c6f616473)](//packagist.org/packages/felixdorn/laravel-navigation)[![codecov](https://camo.githubusercontent.com/f34af607d0473c3ad8f71288fd4006c2063eb0d7ff588b19e4051b610b8216e5/68747470733a2f2f636f6465636f762e696f2f67682f66656c6978646f726e2f6c61726176656c2d6e617669676174696f6e2f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d78455162344468506c72)](https://codecov.io/gh/felixdorn/laravel-navigation)

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

[](#installation)

> Requires [PHP 8.0+](https://php.net/releases)

You can install the package via composer:

```
composer require felixdorn/laravel-navigation
```

Usage
-----

[](#usage)

### Creating a navigation bar

[](#creating-a-navigation-bar)

```
use Felix\Navigation\Navigation;

Navigation::register('dashboardSidebar', function (Navigation $navigation) {

});
```

### Retrieving a navigation bar

[](#retrieving-a-navigation-bar)

```
use Felix\Navigation\Navigation;

Navigation::dashboardSidebar()->toArray();
// alternatively, to get the raw tree underneath:
Navigation::dashboardSidebar()->tree();
```

#### Conditionally rendered items

[](#conditionally-rendered-items)

```
use Felix\Navigation\Item;

$navigation->addIf($isAdmin, 'Settings', function (Item $item) {
    // ...
});
$navigation->addUnless($isReader, 'Articles', function (Item $item) {
    // ...
});
```

### Section

[](#section)

#### Add a section

[](#add-a-section)

```
use Felix\Navigation\Item;
use Felix\Navigation\Section;

$navigation->addSection('Name', function (Section $section) {
    $section->add('Child', function (Item $item) {
        // ...
    });
});
```

#### Conditionally rendered sections

[](#conditionally-rendered-sections)

```
use Felix\Navigation\Section;

$navigation->addSectionIf($isAdmin, 'Admin', function (Section $section) {
    // ...
});
$navigation->addSectionUnless($isReader, 'Bookmarks', function (Section $section) {
    // ...
});
```

### Items

[](#items)

```
/** @var \Felix\Navigation\Item $item **/
$item->route('articles.index');

$item->route('tenant.show', ['tenant' => 1]);

$item->url('https://github.com/felixdorn')

$item->route('articles.index')
    ->activeWhenRouteMatches('articles.*') // active for articles.index / articles.edit / articles.anything

$item->meta(['a' => 'b']);
// same as
$item->a('b');
```

Testing
-------

[](#testing)

```
composer test
```

**Navigation for Laravel** was created by **[Félix Dorn](https://twitter.com/afelixdorn)** under the **[MIT license](https://opensource.org/licenses/MIT)**.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 90.4% 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 ~98 days

Recently: every ~122 days

Total

6

Last Release

1332d ago

Major Versions

0.2.1 → 1.0.02022-09-18

PHP version history (2 changes)0.1.0PHP ^8.0

1.0.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/eeca3822ab1a1281e77e0c4f7bdb671c840417def9884107629952224ce42eb0?d=identicon)[felixdorn](/maintainers/felixdorn)

---

Top Contributors

[![felixdorn](https://avatars.githubusercontent.com/u/55788595?v=4)](https://github.com/felixdorn "felixdorn (47 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (2 commits)")

---

Tags

laravelnavigationpackagephpnavigationhonda

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[spatie/menu

Html menu generator

7592.9M6](/packages/spatie-menu)[verbb/navigation

Create navigation menus for your site.

90683.7k17](/packages/verbb-navigation)[kartik-v/yii2-widget-sidenav

An enhanced side navigation menu styled for bootstrap (sub repo split from yii2-widgets)

364.0M8](/packages/kartik-v-yii2-widget-sidenav)[pingpong/menus

Laravel Menus

70194.4k13](/packages/pingpong-menus)[kartik-v/yii2-widget-affix

A scrollspy and affixed enhanced navigation to highlight page sections (sub repo split from yii2-widgets)

153.8M3](/packages/kartik-v-yii2-widget-affix)[akaunting/laravel-menu

Menu and sidebar management package for Laravel

38233.8k](/packages/akaunting-laravel-menu)

PHPackages © 2026

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