rapidwebltd/laravel-dynamic-menu
Laravel Dynamic Menu lets you build database-driven navigation menus in Laravel without hardcoding links. Define nested menu items, order them, render them in Blade, and automatically highlight the active page for cleaner, more maintainable navigation.
composer require <vendor>/<package>
php artisan vendor:publish --provider="<Vendor>\<Package>\<PackageServiceProvider>"
php artisan migrate
Menu, MenuItem / MenuHeading) and the polymorphic target relation. A menu item may link to any Eloquent model or stand alone as a heading.Page or Post as the polymorphic target, set sibling ordering with decimal positions, then render the tree in a Blade partial.create) to attach items to a parent and assign a decimal position.morphTo (target_type, target_id). Leave the target empty for headings, separators, or custom links. The v1.1.0 release fixes fresh-install persistence for target-less headings.1.0, 1.5, 2.0). Use decimals to insert between siblings without renumbering the whole set.children and target to avoid N+1 queries. Cache the rendered tree or the underlying menu query, invalidating on model events.1.0001 vs 1.0002). Use a sensible step (0.1 or 0.5) and normalise positions occasionally if the tree grows deep.position column and the sibling query scope. If items appear out of order, check for duplicate or null positions and verify the default ordering logic.created, updated, deleted) to clear menu caches. For custom link types, extend the polymorphic target resolution in your own service.How can I help you explore Laravel packages today?