PHPackages                             jacksleight/statamic-bonus-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. jacksleight/statamic-bonus-routes

ActiveLibrary

jacksleight/statamic-bonus-routes
=================================

0.3.4(4mo ago)716.7k↓45.3%2PHP

Since Nov 4Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/jacksleight/statamic-bonus-routes)[ Packagist](https://packagist.org/packages/jacksleight/statamic-bonus-routes)[ RSS](/packages/jacksleight-statamic-bonus-routes/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (1)Versions (9)Used By (0)

Bonus Routes
============

[](#bonus-routes)

This Statamic addon simplifies setting up additional collection and taxonomy based routes by handling the dynamic mounting and data retrieval for you. This is useful for things like:

- Adding registration pages below entry pages in an events collection
- Adding date based archive pages above entry pages in a blog collection
- Mounting a filtered news collection to different sections of a site
- Customising and mounting taxonomy urls

All of this is possible by writing your own custom routes and controllers, this addon just makes it simpler and saves you hard coding the URLs.

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

[](#installation)

You can search for this addon in the `Tools > Addons` section of the Statamic control panel and click **install**, or run the following command from your project root:

```
composer require jacksleight/statamic-bonus-routes
```

Getting Started
---------------

[](#getting-started)

You can define bonus routes using the `Route::bonus()` method. These should be added to your `routes/web.php` file. This method accepts the following arguments:

- **type (string):** The type of route and handle
- **uri (string):** The route URI
- **view (string):** The name of the view that should be rendered
- **data (array, optional):** Any addiitonal data to parse to the template

### Collection Routes

[](#collection-routes)

Two types of collection route are supported, show and index. Show routes work in exactly the same way as Statamic's standard routes, they parse the requested entry to the view template or 404 if nothing is found. Index routes are for listing and general non-entry specific pages.

Collection show routes *must* include all parameters that Statamic's standard route uses. They can included additonal parameters, and they can be in a different order, but they must all be there.

These are some example bonus collection routes.

```
// Add a date based blog archive page
Route::bonus('collection:blog', '{mount}/{year}', 'blog.archive');

// Add a seperate blog post comments page
Route::bonus('collection:blog', '{mount}/{year}/{slug}/comments', 'blog.comments');

// Mount a blog collection to an additional entry
Route::bonus('collection:blog', '{mount:entry-id}/{year}/{slug}', 'blog.show');
```

### Taxonomy Routes

[](#taxonomy-routes)

Two types of taxonomy route are supported, show and index. Show routes work in exactly the same way as Statamic's standard routes, they parse the requested term to the view template or 404 if nothing is found. Index routes are for listing and general non-term specific pages.

Taxonomy show routes *must* include a `slug` parameter.

These are some example bonus taxonomy routes.

```
// Customise a taxonomy's URL
Route::bonus('taxonomy:topics', 'categories/{slug}', 'topics.show');

// Add a seperate posts page under a taxonomy term
Route::bonus('taxonomy:topics', 'topics/{slug}/posts', 'topics.posts');

// Mount a taxonomy to an entry
Route::bonus('taxonomy:topics', '{mount:entry-id}/{slug}', 'topics.show');
```

### Linking to Routes

[](#linking-to-routes)

Bonus routes are just normal Laravel routes. To link to them you need to give them a name and then use the `route` tag in your templates. To give them names call Laravel's name method after defining your route:

```
Route::bonus('collection:blog', '{mount}/{year}', 'blog.archive')->name('blog.archive');
```

Then use the `route` tag in your templates:

```
{{ route:blog.archive year="2022" }}
```

Route Caching
-------------

[](#route-caching)

Bonus routes are just normal Laravel routes that will be cached when using route caching. This means that changes to your mount entries may not be reflected in your routes immediately. This addon provides a utility that allows you to refresh the route cache through the control panel, which you can find under `Utilities > Route Cache Refresh`. Alternatively you can refresh the cache on the command line by running `php artisan route:cache`.

Route Overriding
----------------

[](#route-overriding)

This addon itself does not override, alter or interfere with Statamic’s routing in any way. However, custom Laravel routes do take priority over Statamic routes. If you define a bonus route that’s the same as a Statamic route it will override Statamic. This should be avoided, it’s best to use Statamic’s routing wherever possible.

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance74

Regular maintenance activity

Popularity33

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

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

Every ~163 days

Recently: every ~203 days

Total

8

Last Release

140d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b1acb404d9801e5f633e31efa3403a4735e43ea93c798e3f895ba3264c92c6e?d=identicon)[jacksleight](/maintainers/jacksleight)

---

Top Contributors

[![jacksleight](https://avatars.githubusercontent.com/u/126740?v=4)](https://github.com/jacksleight "jacksleight (66 commits)")[![daun](https://avatars.githubusercontent.com/u/22225348?v=4)](https://github.com/daun "daun (3 commits)")[![godismyjudge95](https://avatars.githubusercontent.com/u/3847288?v=4)](https://github.com/godismyjudge95 "godismyjudge95 (1 commits)")

### Embed Badge

![Health badge](/badges/jacksleight-statamic-bonus-routes/health.svg)

```
[![Health](https://phpackages.com/badges/jacksleight-statamic-bonus-routes/health.svg)](https://phpackages.com/packages/jacksleight-statamic-bonus-routes)
```

###  Alternatives

[statamic/statamic

Statamic

824170.4k](/packages/statamic-statamic)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135192.6k5](/packages/statamic-rad-pack-runway)[statamic/ssg

Generate static sites with Statamic.

254302.4k](/packages/statamic-ssg)[statamic/eloquent-driver

Allows you to store Statamic data in a database.

125598.8k7](/packages/statamic-eloquent-driver)[statamic/seo-pro

65440.7k](/packages/statamic-seo-pro)[rias/statamic-redirect

28298.4k](/packages/rias-statamic-redirect)

PHPackages © 2026

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