Download the PHP package codelinde/laravel-navsmith without Composer
On this page you can find all versions of the php package codelinde/laravel-navsmith. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download codelinde/laravel-navsmith
More information about codelinde/laravel-navsmith
Files in codelinde/laravel-navsmith
Package laravel-navsmith
Short Description Create navigation links from Laravel routes with ease.
License MIT
Homepage https://github.com/codelinde/laravel-navsmith
Informations about the package laravel-navsmith
Navsmith
Navsmith is a lightweight, unintrusive Laravel package for easily creating navigation links out of routes you define. It's particularly useful for SPA-like sites.
Usage
Just define your routes using the navsmith
method and give them route names you'd like to use in your display...
Include the x-navsmith
Blade component...
And you get display-ready HTML links.
Using the current
attribute on the component, you can give the links different styling according to whether
they are the currently-visited page (either CSS styles or class-based styles) and get a SPA-like experience:
Class-based styles (e.g. TailwindCSS)
CSS styles
You can also pass through any attributes to your links. This is particularly useful if you're
using Livewire and want to take advantage of its SPA-like navigation features by
using wire:navigate
.
Furthermore, a navsmith_route
helper function is provided so that you can refer to your Navsmith routes elsewhere in
your code without having to remember the specific naming prefix applied.
Given a route definition like this
And a call to navsmith_route
like this
The HTML will render like this
Requirements
Navsmith requires Laravel 10 or 11 and PHP 8.2+.
Installation
You can install the package via composer:
Customization
You can publish the views to make any desired alterations by running the following command.
Testing
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
- Ryan Linde
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-navsmith with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^10.0||^11.0