PHPackages                             nonetallt/laravel-publish-routes - 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. nonetallt/laravel-publish-routes

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

nonetallt/laravel-publish-routes
================================

Publish routes as a json file that can be utilized by route-repository javascript package.

1.0.0(4y ago)216MITPHPPHP &gt;=7.1

Since Nov 5Pushed 3y ago1 watchersCompare

[ Source](https://github.com/nonetallt/laravel-publish-routes)[ Packagist](https://packagist.org/packages/nonetallt/laravel-publish-routes)[ RSS](/packages/nonetallt-laravel-publish-routes/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

nonetallt/laravel-publish-routes
================================

[](#nonetalltlaravel-publish-routes)

Server-side integration for the [route-repository](https://github.com/nonetallt/route-repository) javascript package.

This package allows you to generate a json file containing your Laravel application routes.

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

[](#installation)

Use composer:

```
composer require nonetallt/laravel-publish-routes --dev

```

Basic usage
-----------

[](#basic-usage)

Publish the configuration:

```
php artisan vendor:publish --provider="Nonetallt\Laravel\Route\Publish\ServiceProvider"

```

Run the command whenever your routes update:

```
php artisan route:publish

```

For the optimal workflow experience, it is recommended to use a task runner with a file watcher to automatically run the command whenever your routes update.

Caveats
-------

[](#caveats)

Note that parsing can get funky for regex matching URI patterns - such routes should not be published.

Configuration
-------------

[](#configuration)

#### outputPath

[](#outputpath)

- Type: string

The filepath for the generated route file. Should have the json extension.

#### outputJsonFlags

[](#outputjsonflags)

- Type: int bitmask

The 2nd argument of [json\_encode](https://www.php.net/manual/en/function.json-encode.php). Used for encoding the resulting output.

#### skipNameless

[](#skipnameless)

- Type: bool

Whether routes that do not define a name should be ignored. The route-repository package relies on route names, so all this option does is throw `Nonetallt\Laravel\Route\Publish\Exception\NamelessRouteException` whenever you attempt to publish a route with no name. This is provided for convenience's sake: you can set the option to true so you don't forget to name a route and then have it silently ignored by the publish command.

#### generateExtra

[](#generateextra)

- Type: callable(`Illuminate\Routing\Route`) : array | `false`

If set to `false`, no extra field is generated for published routes. If set to a callback, the function takes `Illuminate\Routing\Route` as the first argument and should return an array with string keys. This allows you to use the route data to publish whatever extra information you deem important.

#### includeFilters

[](#includefilters)

- Type: array\[callable(`Illuminate\Routing\Route`) : bool | `Nonetallt\Laravel\Route\Publish\Contract\RouteFilter`\]

An array that can contain:

- Callables that take `Illuminate\Routing\Route` as first argument and return bool.
- Instances implementing the `Nonetallt\Laravel\Route\Publish\Contract\RouteFilter` interface.

These filters define which routes should be included when publishing routes. Routes not matched by these filters will not be published.

#### excludeFilters

[](#excludefilters)

- Type: array\[callable(`Illuminate\Routing\Route`) : bool | `Nonetallt\Laravel\Route\Publish\Contract\RouteFilter`\]

An array that can contain:

- Callables that take `Illuminate\Routing\Route` as first argument and return bool.
- Instances implementing the `Nonetallt\Laravel\Route\Publish\Contract\RouteFilter` interface.

These filters defined which routes should be exlcuded when publishing routes. Routes matched by these filters will not be published. Supersedes [includeFilters](#includeFilters). If you wish to only define which routes to exclude, you should use the `Nonetallt\Laravel\Route\Publish\Filter\EverythingFilter` in includeFilters and then exclude the desired routes.

Available Filters
-----------------

[](#available-filters)

The following filters are provided by the package out of the box:

- Nonetallt\\Laravel\\Route\\Publish\\Filter\\CallableFilter
- Nonetallt\\Laravel\\Route\\Publish\\Filter\\EverythingFilter
- Nonetallt\\Laravel\\Route\\Publish\\Filter\\MiddlewareFilter
- Nonetallt\\Laravel\\Route\\Publish\\Filter\\NameFilter
- Nonetallt\\Laravel\\Route\\Publish\\Filter\\NothingFilter
- Nonetallt\\Laravel\\Route\\Publish\\Filter\\PrefixFilter

You can simply use callbacks to quickly define your own custom filters, as callbacks are converted into instances of `Nonetallt\Laravel\Route\Publish\Filter\CallableFilter`. Refer to the [Route API](https://laravel.com/api/8.x/Illuminate/Routing/Route.html) to see available methods you might use for this purpose.

If you wish to create more complex filters that you might for example, share across multiple projects, you should implement the `Nonetallt\Laravel\Route\Publish\Contract\RouteFilter` interface. The interface has only one method you must implement:

```
public function shouldFilter(Illuminate\Routing\Route $route) : bool;
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

1649d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/022935c18503b8dff233563d6791746f4a0d7fee43977a1c9f2664806dea632b?d=identicon)[nonetallt](/maintainers/nonetallt)

---

Top Contributors

[![nonetallt](https://avatars.githubusercontent.com/u/22174322?v=4)](https://github.com/nonetallt "nonetallt (4 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nonetallt-laravel-publish-routes/health.svg)

```
[![Health](https://phpackages.com/badges/nonetallt-laravel-publish-routes/health.svg)](https://phpackages.com/packages/nonetallt-laravel-publish-routes)
```

###  Alternatives

[wireui/wireui

TallStack components

1.8k1.3M16](/packages/wireui-wireui)[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4195.3M84](/packages/livewire-volt)[ramonrietdijk/livewire-tables

Dynamic tables for models with Laravel Livewire

21147.4k](/packages/ramonrietdijk-livewire-tables)

PHPackages © 2026

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