PHPackages                             spatie/laravel-menu - 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. spatie/laravel-menu

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

spatie/laravel-menu
===================

Html menu generator for Laravel

4.2.2(2mo ago)9812.8M↑21.9%8210MITPHPPHP ^8.0CI passing

Since Feb 25Pushed 2mo ago24 watchersCompare

[ Source](https://github.com/spatie/laravel-menu)[ Packagist](https://packagist.org/packages/spatie/laravel-menu)[ Docs](https://github.com/spatie/laravel-menu)[ Fund](https://spatie.be/open-source/support-us)[ RSS](/packages/spatie-laravel-menu/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (55)Used By (10)

 [   ![Logo for laravel-menu]()  ](https://spatie.be/open-source?utm_source=github&utm_medium=banner&utm_campaign=laravel-menu)Fluent interface to build HTML menus in Laravel
===============================================

[](#fluent-interface-to-build-html-menus-in-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/f947edd3cf3972a23af9ddbb52eda2772826a9f5f7b26927c9a12161a6205631/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7370617469652f6c61726176656c2d6d656e752e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/laravel-menu)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Test Status](https://camo.githubusercontent.com/286bb725960f7aaa745febaa3ede0aaddf50f109d8c56c27453d5cc25775f365/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f7370617469652f6c61726176656c2d6d656e752f72756e2d74657374733f6c6162656c3d7465737473)](https://camo.githubusercontent.com/286bb725960f7aaa745febaa3ede0aaddf50f109d8c56c27453d5cc25775f365/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f7370617469652f6c61726176656c2d6d656e752f72756e2d74657374733f6c6162656c3d7465737473)[![Code Style Status](https://camo.githubusercontent.com/a1ddbb477de4bf106a587699ea4ced3fa469faf91993fd435c4f2eac1f5f080d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f7370617469652f6c61726176656c2d6d656e752f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://camo.githubusercontent.com/a1ddbb477de4bf106a587699ea4ced3fa469faf91993fd435c4f2eac1f5f080d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f7370617469652f6c61726176656c2d6d656e752f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)[![Total Downloads](https://camo.githubusercontent.com/ff0234fc1b08c22667b27ceabf336d4fb9bd36987d38571c255f0d85ccbb4e7a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370617469652f6c61726176656c2d6d656e752e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/laravel-menu)

This is the Laravel version of [our menu package](https://github.com/spatie/menu), adding some extras like convenient methods for generating URLs and macros.

Documentation is available at .

Upgrading from version 1? There's a [guide](https://github.com/spatie/laravel-menu#upgrading-to-20) for that!

```
Menu::macro('main', function () {
    return Menu::new()
        ->action('HomeController@index', 'Home')
        ->action('AboutController@index', 'About')
        ->action('ContactController@index', 'Contact')
        ->setActiveFromRequest();
});
```

```

    {!! Menu::main() !!}

```

Spatie is a webdesign agency based in Antwerp, Belgium. You'll find an overview of all our open source projects [on our website](https://spatie.be/opensource).

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

[](#support-us)

[![](https://camo.githubusercontent.com/4ea726a5088c26d7b248e8e52887269933d40d10b9c68b8a72514bb903fb77fd/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f6c61726176656c2d6d656e752e6a70673f743d31)](https://spatie.be/github-ad-click/laravel-menu)

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-menu
```

Usage
-----

[](#usage)

Documentation is available at .

Changelog
---------

[](#changelog)

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

Testing
-------

[](#testing)

```
$ phpunit
```

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

71

—

ExcellentBetter than 100% of packages

Maintenance83

Actively maintained with recent releases

Popularity65

Solid adoption and visibility

Community38

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor2

2 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.

###  Release Activity

Cadence

Every ~70 days

Recently: every ~282 days

Total

53

Last Release

86d ago

Major Versions

0.5.3 → 1.0.02016-03-24

1.3.0 → 2.0.0-beta.12016-09-26

2.1.5 → 3.0.02017-08-30

3.7.1 → 4.0.02021-03-22

PHP version history (5 changes)0.1PHP ^7.0

3.3.1PHP ^7.1

3.5.0PHP ^7.2

3.7.0PHP ^7.3|^8.0

4.0.0PHP ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7535935?v=4)[Spatie](/maintainers/spatie)[@spatie](https://github.com/spatie)

---

Top Contributors

[![sebastiandedeyne](https://avatars.githubusercontent.com/u/1561079?v=4)](https://github.com/sebastiandedeyne "sebastiandedeyne (96 commits)")[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (95 commits)")[![AlexVanderbist](https://avatars.githubusercontent.com/u/6287961?v=4)](https://github.com/AlexVanderbist "AlexVanderbist (7 commits)")[![AdrianMrn](https://avatars.githubusercontent.com/u/12762044?v=4)](https://github.com/AdrianMrn "AdrianMrn (7 commits)")[![ccsliinc](https://avatars.githubusercontent.com/u/5481458?v=4)](https://github.com/ccsliinc "ccsliinc (3 commits)")[![Nielsvanpach](https://avatars.githubusercontent.com/u/10651054?v=4)](https://github.com/Nielsvanpach "Nielsvanpach (3 commits)")[![MasterBratac](https://avatars.githubusercontent.com/u/1082002?v=4)](https://github.com/MasterBratac "MasterBratac (2 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (2 commits)")[![akoepcke](https://avatars.githubusercontent.com/u/5311185?v=4)](https://github.com/akoepcke "akoepcke (2 commits)")[![patinthehat](https://avatars.githubusercontent.com/u/5508707?v=4)](https://github.com/patinthehat "patinthehat (1 commits)")[![smart-one](https://avatars.githubusercontent.com/u/8808096?v=4)](https://github.com/smart-one "smart-one (1 commits)")[![vmitchell85](https://avatars.githubusercontent.com/u/1248035?v=4)](https://github.com/vmitchell85 "vmitchell85 (1 commits)")[![ansien](https://avatars.githubusercontent.com/u/1700132?v=4)](https://github.com/ansien "ansien (1 commits)")[![AyoobMH](https://avatars.githubusercontent.com/u/37803924?v=4)](https://github.com/AyoobMH "AyoobMH (1 commits)")[![cretueusebiu](https://avatars.githubusercontent.com/u/1517945?v=4)](https://github.com/cretueusebiu "cretueusebiu (1 commits)")[![erikn69](https://avatars.githubusercontent.com/u/4933954?v=4)](https://github.com/erikn69 "erikn69 (1 commits)")[![francoism90](https://avatars.githubusercontent.com/u/5028905?v=4)](https://github.com/francoism90 "francoism90 (1 commits)")[![IgnacioCastro0713](https://avatars.githubusercontent.com/u/31707457?v=4)](https://github.com/IgnacioCastro0713 "IgnacioCastro0713 (1 commits)")[![jimirobaer](https://avatars.githubusercontent.com/u/8984769?v=4)](https://github.com/jimirobaer "jimirobaer (1 commits)")[![Omranic](https://avatars.githubusercontent.com/u/406705?v=4)](https://github.com/Omranic "Omranic (1 commits)")

---

Tags

generatehtmllaravelmenunavigationphpspatielaravel-menu

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/spatie-laravel-menu/health.svg)

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

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.8k28.9M627](/packages/spatie-laravel-data)[spatie/laravel-enum

Laravel Enum support

3655.4M31](/packages/spatie-laravel-enum)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[spatie/laravel-feed

Generate rss feeds

9743.6M28](/packages/spatie-laravel-feed)[spatie/laravel-referer

Keep a visitor's original referer in session

532797.4k6](/packages/spatie-laravel-referer)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)

PHPackages © 2026

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