honed / nav
Create backend driven navigation routes with server-side authorization in Laravel.
Fund package maintenance!
Honed
Requires
- php: ^8.2
- honed/core: ^0.7.0
- illuminate/contracts: ^11.0||^12.0
- illuminate/support: ^11.0||^12.0
Requires (Dev)
- inertiajs/inertia-laravel: ^1.2||^2.0
- larastan/larastan: ^3.0
- laravel/pint: ^1.18
- nunomaduro/collision: ^8.1
- orchestra/testbench: ^9.0.0||^10.0.0
- pestphp/pest: ^3.5.1
- pestphp/pest-plugin-arch: ^3.0.0
- pestphp/pest-plugin-laravel: ^3.0
- phpstan/extension-installer: ^1.4.3
- phpstan/phpstan-deprecation-rules: ^2.0.1
- phpstan/phpstan-phpunit: ^2.0.3
This package is not auto-updated.
Last update: 2025-02-25 05:24:33 UTC
README
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
Installation
You can install the package via composer:
composer require honed/nav
Usage
Interact with the Nav
facade to create navigation items.
Nav::items(NavItem::make('Home', '/'), NavItem::make('About', '/about'), NavItem::make('Contact', '/contact'));
You can create groups of navigation items, allowing you to select which ones to send to the page on render. By default, if you don't specify a group, the items will be added to the default
group.
Nav::group('main', [ NavItem::make('Home', '/'), NavItem::make('About', '/about'), NavItem::make('Contact', '/contact'), ]); Nav::use('main');
You can use the SharesNavigation
middleware to share the navigation items with the page automatically using merged props. This will append the navigation items to the page props using the nav
key. If you want to simplify this, you can use the client-side composable useNavigation
to handle this automatically and provide the necessary interfaces. See the documentation for the client package for more information.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.