Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Navigation Laravel Package

spatie/laravel-navigation

Define a navigation tree for Laravel apps and reuse it to build menus, breadcrumbs, and other nav UI. Manage sections, nested items, and active state in PHP, register navigation via service providers/container events, and render however you like.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Unified Navigation System: Standardize navigation logic across a Laravel-based SaaS platform (e.g., admin dashboards, public sites, or multi-tenant apps) to reduce UI inconsistencies and maintenance overhead.
  • Decoupled UI/Logic: Enable frontend teams (React/Vue/Blade) to consume navigation data via APIs (e.g., GraphQL/Laravel Sanctum) without tightly coupling HTML generation to backend logic.
  • Dynamic Navigation: Support role-based, feature-flagged, or tenant-specific menus (e.g., SaaS apps with customizable dashboards) via middleware or policy hooks.
  • Breadcrumbs as a Service: Replace ad-hoc breadcrumb implementations with a centralized solution, improving SEO and UX for content-heavy apps (e.g., CMS, e-commerce).
  • Build vs. Buy: Avoid reinventing navigation state management (e.g., active routes, nested menus) when the package offers a mature, Laravel-native solution with minimal boilerplate.
  • Roadmap: Phase out legacy menu systems (e.g., Spatie’s older laravel-menu) by migrating to this package’s renderless architecture for future scalability.

When to Consider This Package

  • Adopt if:

    • Your app uses Laravel and requires complex, dynamic navigation (e.g., multi-level menus, context-aware breadcrumbs).
    • You prioritize separation of concerns (backend defines structure; frontend renders UI).
    • Your team needs consistent navigation across Blade, SPAs, or mobile apps (via API endpoints).
    • You’re migrating from laravel-menu or need a modern, maintained alternative.
    • Your stakeholders value developer velocity over custom HTML generation (e.g., prefer PHP data shaping over Blade directives).
  • Look elsewhere if:

    • You need pre-built UI components (e.g., styled dropdowns, animations)—this package is renderless.
    • Your navigation is static and simple (e.g., a 3-item footer menu; use Blade partials instead).
    • You’re using a non-Laravel stack (e.g., Django, Rails) or need serverless compatibility.
    • Your team lacks PHP expertise to integrate middleware/policies for dynamic logic.

How to Pitch It (Stakeholders)

For Executives: "This package lets us treat navigation like a first-class citizen in our Laravel apps—centralizing logic for menus, breadcrumbs, and more while keeping UI flexible. It’s like a ‘headless’ navigation system: backend defines the rules (e.g., ‘show X to admins’), and frontend teams own the presentation. This reduces tech debt, speeds up feature delivery (e.g., role-based dashboards), and future-proofs our architecture for SPAs or multi-tenant needs. Low risk: MIT-licensed, actively maintained by Spatie (trusted Laravel contributors), and used by [insert relevant company if applicable]."

For Engineering: *"Spatie’s laravel-navigation replaces ad-hoc menu logic with a clean, declarative API. Key wins:

  • No more spaghetti code: Define navigation once (e.g., Navigation::make()->add(...)) and reuse it for menus, breadcrumbs, or APIs.
  • Dynamic by design: Hook into middleware or policies to hide/show items (e.g., if (auth()->user()->isAdmin())).
  • Frontend-friendly: Output JSON for SPAs or Blade for server-rendered views—your choice.
  • Lightweight: ~500 stars, MIT license, and changelog shows steady updates. Tradeoff: We’ll need to write minimal Blade/JS to render UI, but the payoff is maintainable, scalable navigation. Let’s prototype a dashboard menu to compare it to our current approach."*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport