https://github.com/spatie/laravel-menu
Html menu generator for Laravel
https://github.com/spatie/laravel-menu
generate html laravel menu navigation php
Last synced: 2 days ago
JSON representation
Html menu generator for Laravel
- Host: GitHub
- URL: https://github.com/spatie/laravel-menu
- Owner: spatie
- License: mit
- Created: 2016-02-22T19:35:39.000Z (about 9 years ago)
- Default Branch: main
- Last Pushed: 2025-02-21T10:36:55.000Z (about 2 months ago)
- Last Synced: 2025-04-14T02:57:49.304Z (2 days ago)
- Topics: generate, html, laravel, menu, navigation, php
- Language: PHP
- Homepage: https://freek.dev/414-a-modern-package-to-generate-html-menus
- Size: 136 KB
- Stars: 957
- Watchers: 25
- Forks: 82
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
- awesome-laravel-framework - Laravel Menu - Html menu generator for Laravel (Popular Packages)
- laravel-awesome - Laravel Menu - Html menu generator for Laravel (Popular Packages)
- awesome-laravel - Laravel Menu - Html menu generator for Laravel (Popular Packages)
README
# Html Menu Generator for Laravel
[](https://packagist.org/packages/spatie/laravel-menu)
[](LICENSE.md)


[](https://packagist.org/packages/spatie/laravel-menu)This is the Laravel version of [our menu package](https://github.com/spatie/menu) adds some extras like convenience methods for generating URLs and macros.
Documentation is available at https://spatie.be/docs/menu.
Upgrading from version 1? There's a [guide](https://github.com/spatie/laravel-menu#upgrading-to-20) for that!
```php
Menu::macro('main', function () {
return Menu::new()
->action('HomeController@index', 'Home')
->action('AboutController@index', 'About')
->action('ContactController@index', 'Contact')
->setActiveFromRequest();
});
``````html
{!! 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
[
](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
You can install the package via composer:
``` bash
composer require spatie/laravel-menu
```## Usage
Documentation is available at https://spatie.be/docs/menu.
## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
## Testing
``` bash
$ phpunit
```## Contributing
Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.
## Security
If you've found a bug regarding security please mail [[email protected]](mailto:[email protected]) instead of using the issue tracker.
## Credits
- [Sebastian De Deyne](https://github.com/sebastiandedeyne)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.