Building a Dynamic, Permission-Aware Navigation System for Multi-Tenant Laravel SaaS
Most SaaS navigation tutorials show you how to render a <nav> with 5 links. Real multi-tenant apps need something very different: menus that change based on who's logged in, what company they...

Source: DEV Community
Most SaaS navigation tutorials show you how to render a <nav> with 5 links. Real multi-tenant apps need something very different: menus that change based on who's logged in, what company they're in, and what permissions they have. I built a complete navigation module for Kohana.io - a production CRM/ERP - and I'm now extracting it into LaraFoundry, an open-source SaaS framework for Laravel. This post covers the full system: backend menu building, permission filtering, sub-menu routing, the First Allowed Route pattern, frontend rendering (desktop + mobile), and testing. The Problem In a multi-tenant SaaS with role-based access, navigation has to solve several problems at once: Admins see a completely different menu than regular users (admin panel vs business modules) Company owners see all modules (Orders, Warehouse, Accounting, Production...) Employees see only modules they have permissions for Each module has sub-pages with potentially different permission requirements When a us