PHPackages                             mprince2k18/route-priority - 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. [Framework](/categories/framework)
4. /
5. mprince2k18/route-priority

ActiveLibrary[Framework](/categories/framework)

mprince2k18/route-priority
==========================

Package to add priority to Laravel 10 routes

10PHP

Since Mar 22Pushed 3y ago1 watchersCompare

[ Source](https://github.com/mprince2k18/route-priority)[ Packagist](https://packagist.org/packages/mprince2k18/route-priority)[ RSS](/packages/mprince2k18-route-priority/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Package to add priority to Laravel 5 routes
-------------------------------------------

[](#package-to-add-priority-to-laravel-5-routes)

[![Latest Stable Version](https://camo.githubusercontent.com/527ddcdb9b5359ded99f83b2922cd5861c761d4e8f64c4bbb5aab4dfd879cd57/68747470733a2f2f706f7365722e707567782e6f72672f6d7072696e6365326b31382f726f7574652d7072696f726974792f762f737461626c65)](https://packagist.org/packages/mprince2k18/route-priority)[![Total Downloads](https://camo.githubusercontent.com/fc04622c889c497ec21217b8a1161d556d53f08ee137afd051abba02d4519962/68747470733a2f2f706f7365722e707567782e6f72672f6d7072696e6365326b31382f726f7574652d7072696f726974792f646f776e6c6f616473)](https://packagist.org/packages/mprince2k18/route-priority)[![Latest Unstable Version](https://camo.githubusercontent.com/ae19b7f15ee6b416ccad1802087cd46a7f022f00df7f093c7b4de30b7c4ef76b/68747470733a2f2f706f7365722e707567782e6f72672f6d7072696e6365326b31382f726f7574652d7072696f726974792f762f756e737461626c65)](https://packagist.org/packages/mprince2k18/route-priority)[![License](https://camo.githubusercontent.com/4f1b2d67aad473b90f242c8f4db8ea68f4ee4331072c8e0738b0445cb782e607/68747470733a2f2f706f7365722e707567782e6f72672f6d7072696e6365326b31382f726f7574652d7072696f726974792f6c6963656e7365)](https://packagist.org/packages/mprince2k18/route-priority)

### Installation

[](#installation)

1. Add `mprincek18/route-priority` to `composer.json`.

    ```
    composer require mprincek18/route-priority

    ```

2)Run `composer update` to pull down the latest version of the package.

3)Now open up `app/config/app.php` and add the service provider to your `providers` array.

```
Mprince\RoutePriority\RoutePriorityServiceProvider::class,

```

4)Add the trait to `App\Http\Kernel`

```
use \Mprince\RoutePriority\RouterTrait;

```

### Usage

[](#usage)

Change routes priority:

```
Route::get('test', ['uses' => 'Controller@showAction'])->setPriority(100);
```

### Default Priority

[](#default-priority)

Default priority is `50`. Higher priority - values from 50 and above, lower priority - `49` and below.

### Usage example

[](#usage-example)

```
Route::get('/test/{slug}', …);
Route::get('/test/hello', …);
```

In this example second route will not work. Add priority 0 to the first route will fix the error:

```
Route::get('/test/{slug}', …)->setPriority(0);
Route::get('/test/hello', …);
```

Second route now has higher priority.

### Group priority

[](#group-priority)

You can put priority to groups:

```
Route::group(['prefix' => 'test-group', 'priority' => 10], function () {
	Route::get('/test/hello', function () {
	    return 'First group';
	});
});

Route::group(['prefix' => 'test-group', 'priority' => 20], function () {
	Route::get('/test/hello', function () {
	    return 'Second group';
	});
});
```

Second group has higher priority then First group. All routes in the group will has the same priority as the group.

###  Health Score

14

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity23

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/43857625?v=4)[Mohammad Prince](/maintainers/mprince2k18)[@mprince2k18](https://github.com/mprince2k18)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/mprince2k18-route-priority/health.svg)

```
[![Health](https://phpackages.com/badges/mprince2k18-route-priority/health.svg)](https://phpackages.com/packages/mprince2k18-route-priority)
```

###  Alternatives

[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k39.6M300](/packages/laravel-dusk)[nineinchnick/edatatables

Grid widget for the Yii Framework, wrapper for the DataTables jQuery plugin

173.2k](/packages/nineinchnick-edatatables)[link-cloud/fast-hyperf

LinkCloud Fast Hyperf

241.2k1](/packages/link-cloud-fast-hyperf)

PHPackages © 2026

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