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

ActiveLibrary

falkan3/laravel-navigation
==========================

Manage menus, breadcrumbs, and other navigational elements in Laravel apps

02PHP

Since Mar 18Pushed 3y agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

[![](https://camo.githubusercontent.com/2bedf63f24cda7efab02da955dc11fb7ef8a060e2f26b73c33a7aac84529b8a3/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f737570706f72742d756b7261696e652e7376673f743d31)](https://supportukrainenow.org)

Manage menus, breadcrumbs, and other navigational elements in Laravel apps
==========================================================================

[](#manage-menus-breadcrumbs-and-other-navigational-elements-in-laravel-apps)

[![Latest Version on Packagist](https://camo.githubusercontent.com/053c1c5b1eb31a94d8f100ae71de233bef4c27dc045f67c25c3610332a735313/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7370617469652f6c61726176656c2d6e617669676174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/laravel-navigation)[![run-tests](https://github.com/spatie/laravel-navigation/workflows/run-tests/badge.svg)](https://github.com/spatie/laravel-navigation/workflows/run-tests/badge.svg)[![Total Downloads](https://camo.githubusercontent.com/c641047b808aad23c94330c816c7916fd0bd3db1dac2b29371cd018b5875ee5f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370617469652f6c61726176656c2d6e617669676174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/laravel-navigation)

Laravel Navigation is meant to be the spiritual successor of [Laravel Menu](https://github.com/spatie/laravel-menu). Laravel Menu will still be actively maintained, but there are a few principal differences between the two packages.

The main goal of Laravel Menu is to build HTML menus from PHP. Laravel Navigation describes an application's navigation tree, which can be used as a base to create navigational elements like menus and breadcrumbs. Laravel Menu has a rich API for HTML generation. Laravel Navigation doesn't do any HTML generation (although we might ship some Blade files in the future). Instead, Laravel Navigation should give you the flexibility to build your own UI without worrying about the complexity of navigation trees and active state. Think of it as a [renderless component](https://adamwathan.me/renderless-components-in-vuejs/).

```
// typically, in a service provider

Navigation::make()
    ->add('Home', route('home'))
    ->add('Blog', route('blog.index'), function (Section $section) {
        $section
            ->add('All posts', route('blog.index'))
            ->add('Topics', route('blog.topics.index'));
    })
    ->addIf(Auth::user()->isAdmin(), function (Navigation $navigation) {
        $navigation->add('Admin', route('admin.index'));
    });
```

A navigation object can be rendered to a tree, or to breadcrumbs.

Some examples when visiting `/blog/topics/laravel`:

```
// Render to tree
Navigation::make()->tree();
```

```
[
    { "title": "Home", "url": "/", "active": false, "children": [] },
    {
        "title": "Blog",
        "url": "/blog",
        "active": false,
        "children": [
            { "title": "All posts", "url": "/blog", "active": false, "children": [] },
            { "title": "Topics", "url": "/blog/topics", "active": true, "children": [] }
        ],
    },
    { "title": "Admin", "url": "/admin", "active": false, "children": [] }
]
```

```
// Append additional pages in your controller
Navigation::make()->activeSection()->add($topic->name, route('blog.topics.show', $topic));

// Render to breadcrumbs
Navigation::make()->breadcrumbs();
```

```
[
    { "title": "Blog", "url": "/blog" },
    { "title": "Topics", "url": "/blog/topics" },
    { "title": "Laravel", "url": "/blog/topics/laravel" }
]
```

```
// Render the current section
Navigation::make()->current();
```

```
{ "title": "Home", "url": "/", "attributes": [] }
```

Support us
----------

[](#support-us)

[![](https://camo.githubusercontent.com/024f4be269d14169f4bff971abd158129fc5c3ce255cf3204fe02e93313364aa/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f6c61726176656c2d6e617669676174696f6e2e6a70673f743d31)](https://spatie.be/github-ad-click/laravel-navigation)

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).

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

[](#installation)

You can install the package via composer:

```
composer require spatie/laravel-navigation
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you've found a bug regarding security please mail  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Sebastian De Deyne](https://github.com/sebastiandedeyne)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

 Bus Factor3

3 contributors hold 50%+ of commits

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1ca0a8a308391ec21dd333304bc4a4a6a3ea00dd3cd56f3b5c5aa2b2ba51a1dc?d=identicon)[falkan3](/maintainers/falkan3)

---

Top Contributors

[![sebastiandedeyne](https://avatars.githubusercontent.com/u/1561079?v=4)](https://github.com/sebastiandedeyne "sebastiandedeyne (23 commits)")[![alexmanase](https://avatars.githubusercontent.com/u/10696975?v=4)](https://github.com/alexmanase "alexmanase (14 commits)")[![Nielsvanpach](https://avatars.githubusercontent.com/u/10651054?v=4)](https://github.com/Nielsvanpach "Nielsvanpach (12 commits)")[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (11 commits)")[![AdrianMrn](https://avatars.githubusercontent.com/u/12762044?v=4)](https://github.com/AdrianMrn "AdrianMrn (7 commits)")[![riasvdv](https://avatars.githubusercontent.com/u/3626559?v=4)](https://github.com/riasvdv "riasvdv (6 commits)")[![patinthehat](https://avatars.githubusercontent.com/u/5508707?v=4)](https://github.com/patinthehat "patinthehat (6 commits)")[![innocenzi](https://avatars.githubusercontent.com/u/16060559?v=4)](https://github.com/innocenzi "innocenzi (6 commits)")[![rubenvanassche](https://avatars.githubusercontent.com/u/619804?v=4)](https://github.com/rubenvanassche "rubenvanassche (5 commits)")[![Falkan3](https://avatars.githubusercontent.com/u/15730072?v=4)](https://github.com/Falkan3 "Falkan3 (2 commits)")[![martinszemitis](https://avatars.githubusercontent.com/u/77287264?v=4)](https://github.com/martinszemitis "martinszemitis (2 commits)")[![angeljqv](https://avatars.githubusercontent.com/u/79208641?v=4)](https://github.com/angeljqv "angeljqv (1 commits)")[![richardkeep](https://avatars.githubusercontent.com/u/3874381?v=4)](https://github.com/richardkeep "richardkeep (1 commits)")[![hopkins385](https://avatars.githubusercontent.com/u/98618192?v=4)](https://github.com/hopkins385 "hopkins385 (1 commits)")[![AlexVanderbist](https://avatars.githubusercontent.com/u/6287961?v=4)](https://github.com/AlexVanderbist "AlexVanderbist (1 commits)")

### Embed Badge

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

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

PHPackages © 2026

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