tornado-engine / nav
Tornado Engine core-module: the site's navigation menu. Other modules add their items to it.
v0.4.0
2026-11-13 21:02 UTC
Requires
- php: ^8.4
- illuminate/support: ^13.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-13 21:03:36 UTC
README
A Tornado Engine core-module: the site's navigation menu. It shows a top bar on larger screens and a menu button on phones.
Adding menu items from a module
Add your items in your service provider's boot():
use TornadoEngine\Nav\Nav; public function boot(): void { // Only if Nav is installed. $this->callAfterResolving(Nav::class, function (Nav $nav) { // In the top bar. $nav->add('Notes', 'notes.index', active: 'notes.*', order: 50); // In a dropdown in the top bar. $nav->group('tools', 'Tools', order: 40); $nav->add('Inventory', 'inventory.index', group: 'tools'); // In the menu under the user's name, above Log Out. $nav->user('My settings', 'notes.settings'); }); }
canlimits an item to users with a permission, checked with Laravel's$user->can():$nav->add('Reports', 'reports.index', can: 'reports.view'). A dropdown only shows when the user can see at least one item in it.- Lower
ordernumbers come first.activeis the route name pattern that marks the item as the current page.