Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Laravel
  3. Laravel Menu

Laravel Menu

MITPHP4.2.2

A fluent interface package for generating HTML menus in Laravel applications.

Visit WebsiteGitHubGitHub
980 stars82 forks0 contributors

What is Laravel Menu?

Spatie Laravel Menu is a PHP package that provides a fluent interface for generating HTML menus in Laravel applications. It solves the problem of building and managing navigation menus by offering an expressive, chainable API that integrates with Laravel's routing and templating systems. The package extends the base Spatie Menu library with Laravel-specific conveniences like action helpers and macros.

Target Audience

Laravel developers who need to build and maintain HTML navigation menus in their web applications, particularly those looking for a clean, expressive alternative to manual menu construction.

Value Proposition

Developers choose this package for its seamless Laravel integration, fluent API that improves code readability, and time-saving features like automatic active state management and reusable menu macros.

Overview

Html menu generator for Laravel

Use Cases

Best For

  • Building navigation menus with a fluent, chainable API in Laravel
  • Generating HTML menus that automatically highlight the current page
  • Creating reusable menu components via macros for consistent navigation
  • Integrating menu generation with Laravel's routing and action helpers
  • Reducing boilerplate code when constructing complex navigation structures
  • Rendering clean HTML menus directly in Blade templates

Not Ideal For

  • Projects needing pre-styled, drop-in menu components without custom CSS work
  • Applications not built on Laravel, as it tightly integrates with Laravel's routing and helpers
  • Highly dynamic menus requiring extensive JavaScript interactivity or real-time updates
  • Simple static navigation that can be hardcoded directly in Blade templates without package overhead

Pros & Cons

Pros

Expressive Fluent API

The chainable methods, like Menu::new()->action()->setActiveFromRequest(), make menu building readable and reduce boilerplate, as shown in the README example.

Seamless Laravel Integration

It provides Laravel-specific helpers such as action() for URL generation, leveraging Laravel's routing system for easier navigation setup.

Reusable Menu Macros

Macros allow defining reusable menu templates, ensuring consistent navigation across the application, as demonstrated with Menu::macro('main', ...).

Automatic Active State

The setActiveFromRequest() method automatically highlights the current menu item based on the request, simplifying active state management.

Cons

External Documentation Dependency

The README directs users to https://spatie.be/docs/menu for full documentation, which can be inconvenient compared to self-contained docs in the repository.

Breaking Changes in Versions

Upgrading from version 1 requires a dedicated guide, indicating significant changes that could disrupt existing implementations and add migration effort.

No Built-In Styling

It generates clean HTML but leaves all styling to the developer, requiring additional CSS work for visual presentation.

Frequently Asked Questions

Quick Stats

Stars980
Forks82
Contributors0
Open Issues0
Last commit1 month ago
CreatedSince 2016

Tags

#fluent-interface#laravel#php-package#menu#html#blade-templates#backend#php#web-development#generate#navigation

Built With

P
PHP
L
Laravel

Links & Resources

Website

Included in

Laravel13.0k
Auto-fetched 16 hours ago

Related Projects

LiveWireLiveWire

A full-stack framework for Laravel that takes the pain out of building dynamic UIs.

Stars23,556
Forks1,742
Last commit2 days ago
Debug BarDebug Bar

Debugbar for Laravel (Integrates PHP Debug Bar)

Stars19,270
Forks1,617
Last commit14 days ago
IDE HelperIDE Helper

IDE Helper for Laravel

Stars14,953
Forks1,191
Last commit14 days ago
Intervention ImageIntervention Image

PHP Image Processing

Stars14,356
Forks1,495
Last commit5 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub