PHPackages                             suitetea/quick-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. suitetea/quick-routes

ArchivedLibrary

suitetea/quick-routes
=====================

QuickRoutes simplifies and shortens mundane and repeated declaration of routes and controller methods.

0.8.5(11y ago)2193MITPHPPHP &gt;=5.3.0

Since Feb 26Pushed 11y ago4 watchersCompare

[ Source](https://github.com/SuiteTea/quick-routes)[ Packagist](https://packagist.org/packages/suitetea/quick-routes)[ RSS](/packages/suitetea-quick-routes/feed)WikiDiscussions develop Synced 2mo ago

READMEChangelogDependencies (1)Versions (8)Used By (0)

Quick Routes for Laravel
========================

[](#quick-routes-for-laravel)

Do you ever find yourself declaring the same types of routes over and over again through multiple controllers even though they all do and look basically the same thing/way? That's where Quick Routes comes in.

Turn this:

```
Route::get('users', 'UserController@index');
Route::post('users', array(
    'as' => 'user.create',
    'uses' => 'UserController@create'
));
Route::post('users/{id}', array(
    'as' => 'user.edit',
    'uses' => 'UserController@update'
))->where(array(
    'id' => '[0-9]+'
));
Route::get('users/{id}/delete', array(
    'as' => 'user.delete',
    'uses' => 'UserController@delete'
))->where(array(
    'id' => '[0-9]+'
));

Route::get('tweets', 'TweetController@index');
Route::post('tweets', array(
    'as' => 'tweet.create',
    'uses' => 'TweetController@create'
));
Route::post('tweets/{id}', array(
    'as' => 'tweet.edit',
    'uses' => 'TweetController@update'
))->where(array(
    'id' => '[0-9]+'
));
Route::get('tweets/{id}/delete', array(
    'as' => 'tweet.delete',
    'uses' => 'TweetController@delete'
))->where(array(
    'id' => '[0-9]+'
));

```

into this:

```
QuickRoutes::register('users', ['index', 'create', 'edit', 'delete']);
QuickRoutes::register('tweets', '*');

```

\*you can specify which routes to use, or simply use all ("\*")

---

The magic happens by setting default routes in an array either through a config file or setting it.

There are multiple ways to set the default routes.

1. The package config found in "app/config/suitetea/quick-routes" (available after publish package config).
2. Calling `QuickRoutes::setDefault()` and passing in a properly formatted array.
3. Overriding the defaults per register call. There is an option third parameter part of `register` that you can pass routes to be used instead of the global defaults.

---

Additionally, you can group routes by using different default sets. Ex:

```
$set_1 = array(); // Declare your routes here
QuickRoutes::setDefault($set_1); // Register calls after this will use $set_1
QuickRoutes::register('users', ['route_1', 'route_3']);
QuickRoutes::register('someroute', '*');

$set_2 = array(); // Another set of routes
QuickRoutes::setDefault($set_2); // Register calls after this will use $set_2
QuickRoutes::register('anotherroute', ['foo', 'bar']);

```

---

New in 0.8.0
------------

[](#new-in-080)

Fixed a bug where if a HTTP method wasn't specified, the previously declared method was used, resulting in unexpected and unwanted results.

The second parameter in the `register` method is now optional. If not set, all routes will be used by default. The exception to this is when overriding the default route set for a single instance. In this case, the asterisk ('\*') may still be used.

```
QuickRoutes::register('users'); // assumes all
QuickRoutes::register('settings', '*', $settings_routes);

```

Introduced `with` method. Using `with` merges default routes with a set of routes given for a single instance.

For example, this:

```
$default_routes = [
    'index' => [
        'pattern' => '/',
    ],
    'create' => [
        'pattern' => 'create',
        'methods' => ['get','post']
    ]
];

$image_routes = [
    'img_create' => [
        'pattern' => 'create/image'
        'methods' => ['post']
    ]
];

QuickRoutes::register('users', '*', array_merge($default_routes, $image_routes));

```

is equivalent to this:

```
QuickRoutes::with($image_routes)->register('users');

```

Also, you can define a custom uses value, including a Closure:

$image\_routes = \[ 'img\_create' =&gt; \[ 'pattern' =&gt; 'create/image' 'methods' =&gt; \['post'\], 'uses' =&gt; function() { return Redirect::route('image.view'); } \] \];

New in 0.7.0
------------

[](#new-in-070)

You can now create multiple methods per route, just pass the methods parameter as an array.

Installation
============

[](#installation)

Via Composer

```
{
    "require": {
        "suitetea/quick-routes": "dev-develop"
    }
}

```

The default routes array should be in the following format:

```
$default_routes = [
   'index' => [
       'pattern' => '/',
   ],
   'create' => [
       'pattern' => 'create',
       'methods' => ['get','post']
   ],
   'edit' => [
       'pattern' => '{id}/edit',
       'where' => ['id' => '[0-9]+'],
       'methods' => ['get','post']
   ],
   'view' => [
       'pattern' => '{id}',
       'where' => ['id' => '0-9]+']
   ]
];

```

Optionally, you can publish the package config file and set default routes there.

```
php artisan config:publish suitetea/quick-routes

```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85.7% 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 ~44 days

Recently: every ~64 days

Total

7

Last Release

4192d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ca2a06591a8c5730d66cd7dd66e4e2e797b8f1e7acaf82e13a837fc80ba02463?d=identicon)[stevenwadejr](/maintainers/stevenwadejr)

![](https://avatars.githubusercontent.com/u/2482638?v=4)[Matthew Cuyar](/maintainers/mcuyar)[@mcuyar](https://github.com/mcuyar)

---

Top Contributors

[![stevenwadejr](https://avatars.githubusercontent.com/u/1508485?v=4)](https://github.com/stevenwadejr "stevenwadejr (12 commits)")[![mcuyar](https://avatars.githubusercontent.com/u/2482638?v=4)](https://github.com/mcuyar "mcuyar (2 commits)")

### Embed Badge

![Health badge](/badges/suitetea-quick-routes/health.svg)

```
[![Health](https://phpackages.com/badges/suitetea-quick-routes/health.svg)](https://phpackages.com/packages/suitetea-quick-routes)
```

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[namu/wirechat

A Laravel Livewire messaging app for teams with private chats and group conversations.

54324.5k](/packages/namu-wirechat)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

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

PHPackages © 2026

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