PHPackages                             codelinde/laravel-navsmith - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. codelinde/laravel-navsmith

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

codelinde/laravel-navsmith
==========================

Create navigation links from Laravel routes with ease.

0.1.0(1y ago)114[4 PRs](https://github.com/codelinde/laravel-navsmith/pulls)MITPHPPHP ^8.2CI passing

Since Aug 12Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/codelinde/laravel-navsmith)[ Packagist](https://packagist.org/packages/codelinde/laravel-navsmith)[ Docs](https://github.com/codelinde/laravel-navsmith)[ GitHub Sponsors](https://github.com/CodeLinde)[ RSS](/packages/codelinde-laravel-navsmith/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (13)Versions (6)Used By (0)

Navsmith
========

[](#navsmith)

[![Latest Version on Packagist](https://camo.githubusercontent.com/2e4f630e4ab6c921e90c56890d73e5497586a2a36dd245fef39730f562e78a91/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f64656c696e64652f6c61726176656c2d6e6176736d6974682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/codelinde/laravel-navsmith)[![GitHub Tests Action Status](https://camo.githubusercontent.com/67ec98e5597dcef81aded244161560d0540e655fa5db44018b5a383e138e9e3b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636f64656c696e64652f6c61726176656c2d6e6176736d6974682f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/codelinde/laravel-navsmith/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/26f50b866b2316d878bbecda86af94b3b6b966329e246baed4d9f9444431277f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636f64656c696e64652f6c61726176656c2d6e6176736d6974682f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/codelinde/laravel-navsmith/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/ab736a393cf69bf033d239d5f5cfc8ad95d1b2effff6e12e56c7b19a0e735c48/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636f64656c696e64652f6c61726176656c2d6e6176736d6974682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/codelinde/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
-----

[](#usage)

Just define your routes using the `navsmith` method and give them route names you'd like to use in your display...

```
Route::navsmith(function () {
    Route::get('/', Welcome::class)->name('home');
    Route::get('/about', About::class)->name('about');
    Route::get('/contact', Contact::class)->name('contact');
});
```

Include the `x-navsmith` Blade component...

```

```

And you get display-ready HTML links.

```

    Home

    About

    Contact

```

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](https://tailwindcss.com/))**

```

Home
```

**CSS styles**

```

Home
```

You can also pass through any attributes to your links. This is particularly useful if you're using [Livewire](https://livewire.laravel.com) and want to take advantage of its SPA-like navigation features by using `wire:navigate`.

```

Home
```

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

```
Route::navsmith(function () {
    Route::get('/a-cumbersome-url', Contact::class)->name('contact');
});
```

And a call to `navsmith_route` like this

```
Please visit the contact page to send us an e-mail.
```

The HTML will render like this

```
Please visit the contact page to send us an e-mail.
```

Requirements
------------

[](#requirements)

Navsmith requires Laravel 10 or 11 and PHP 8.2+.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require codelinde/navsmith
```

Customization
-------------

[](#customization)

You can publish the views to make any desired alterations by running the following command.

```
php artisan vendor:publish --tag="navsmith-views"
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Ryan Linde](https://github.com/codelinde)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance66

Regular maintenance activity

Popularity7

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

639d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/03e50e4fe1fa234851b676a98387ae380e1e3634ec605289944c8bc62be59960?d=identicon)[codelinde](/maintainers/codelinde)

---

Top Contributors

[![codelinde](https://avatars.githubusercontent.com/u/15930857?v=4)](https://github.com/codelinde "codelinde (10 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (5 commits)")

---

Tags

laravelcodelindenavsmithlaravel-navsmith

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/codelinde-laravel-navsmith/health.svg)

```
[![Health](https://phpackages.com/badges/codelinde-laravel-navsmith/health.svg)](https://phpackages.com/packages/codelinde-laravel-navsmith)
```

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.7k28.9M627](/packages/spatie-laravel-data)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
