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(4mo ago)9822.9M↓42.2%8211MITPHPPHP ^8.0CI passing

Since Feb 25Pushed 1mo 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 2d ago

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

 [   ![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://github.com/spatie/laravel-menu/actions/workflows/run-tests.yml/badge.svg)](https://github.com/spatie/laravel-menu/actions/workflows/run-tests.yml/badge.svg)[![Code Style Status](https://github.com/spatie/laravel-menu/actions/workflows/php-cs-fixer.yml/badge.svg)](https://github.com/spatie/laravel-menu/actions/workflows/php-cs-fixer.yml/badge.svg)[![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

Maintenance86

Actively maintained with recent releases

Popularity65

Solid adoption and visibility

Community39

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

132d 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

[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (96 commits)")[![sebastiandedeyne](https://avatars.githubusercontent.com/u/1561079?v=4)](https://github.com/sebastiandedeyne "sebastiandedeyne (96 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-permission

Permission handling for Laravel 12 and up

12.9k102.4M1.4k](/packages/spatie-laravel-permission)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[illuminate/events

The Illuminate Events package.

13557.0M2.1k](/packages/illuminate-events)[illuminate/pagination

The Illuminate Pagination package.

12234.1M1.0k](/packages/illuminate-pagination)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M194](/packages/laravel-ai)

PHPackages © 2026

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