PHPackages                             lararoutes/lumen-custom-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. lararoutes/lumen-custom-routes

ActiveLibrary

lararoutes/lumen-custom-routes
==============================

Lumen package to help you customize your routes apiResources.

v1.2(5y ago)115231MITPHPPHP ^7.2

Since Aug 1Pushed 5y ago3 watchersCompare

[ Source](https://github.com/Mahmoud-Italy/Lararoutes-lumen-custom-routes)[ Packagist](https://packagist.org/packages/lararoutes/lumen-custom-routes)[ RSS](/packages/lararoutes-lumen-custom-routes/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (3)DependenciesVersions (3)Used By (0)

Lumen Custom Routes
===================

[](#lumen-custom-routes)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/22fb9f685b8e3fbe9dd9e4a1b9d3647cb53ea26741f229a416eb6c1f0a70f5e2/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4d61686d6f75642d4974616c792f4c617261726f757465732d6c756d656e2d637573746f6d2d726f757465732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Mahmoud-Italy/Lararoutes-lumen-custom-routes/?branch=master)[![Build Status](https://camo.githubusercontent.com/9c9bb37037946028a3ff70dcdb821f62d219b2d033f9897ed2c4b609aa138d63/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4d61686d6f75642d4974616c792f4c617261726f757465732d6c756d656e2d637573746f6d2d726f757465732f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Mahmoud-Italy/Lararoutes-lumen-custom-routes/build-status/master)[![Code Intelligence Status](https://camo.githubusercontent.com/6dfc0334c96cbdb665162ea7515d8419c32396de79bb0b859069b7524f217777/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4d61686d6f75642d4974616c792f4c617261726f757465732d6c756d656e2d637573746f6d2d726f757465732f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d6d6173746572)](https://scrutinizer-ci.com/code-intelligence)[![Total Downloads](https://camo.githubusercontent.com/d193a824be094076669bbe090b27be8f1151a22336006e469a559db5e31e3ff9/68747470733a2f2f706f7365722e707567782e6f72672f6c617261726f757465732f6c756d656e2d637573746f6d2d726f757465732f642f746f74616c2e737667)](https://packagist.org/packages/lararoutes/lumen-custom-routes)

[![lumen-custom-routes](assets/background.png)](assets/background.png)

Lumen package to help you customize your routes. Specialize for whom using lumen,
If you don't you better do now, Lumen is stunningly micro-framework **Faster 4x than laravel**.

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

[](#installation)

```
composer require lararoutes/lumen-custom-routes
```

Usage
=====

[](#usage)

Add those lines in top of routes/web.php

```
  use Lararoutes\Lumen\CustomRoutes;
  $app = new CustomRoutes($router);
```

That's it. done

Example
=======

[](#example)

Instead of doing this shit

```
  $router->get('posts', 'PostController@index');
  $router->post('posts', 'PostController@store');
  $router->get('posts/{id}', 'PostController@show');
  $router->put('posts/{id}', 'PostController@update');
  $router->delete('posts/{id}', 'PostController@destroy');
```

We can simple do this now

```
$app->apiResource('posts', 'PostController');
```

However, you can also custom your routes as much as u want in Lararoutes\\Lumen\\CustomRoutes.php

```
    function apiResoruce($uri, $controller)
    {
        $this->app->get($uri, $controller.'@index');
        $this->app->post($uri, $controller.'@store');
        $this->app->get($uri.'/{id}', $controller.'@show');
        $this->app->put($uri.'/{id}', $controller.'@update');
        $this->app->delete($uri.'/{id}', $controller.'@destroy');

        // feel free to add more..

    }
```

Another example for what you can do else
Instead of doing this

```
  $router->group(['prefix' => 'auth'], function ($router) {
    $router->post('resister', 'AuthController@register');
    $router->post('login', 'AuthController@login');
    $router->post('logout', 'AuthController@logout');
    $router->post('refresh', 'AuthController@refresh');
    $router->get('me', 'AuthController@me');
  }
```

You can just drop one line like that

```
$app->authResource('auth', 'AuthController');
```

Just create new function authResource in Lararoutes\\Lumen\\CustomRoutes.php

```
  function authResource($uri, $controller)
    {
      $this->app->post($uri.'/register', $controller.'@register');
      $this->app->post($uri.'/login', $controller.'@login');
      $this->app->post($uri.'/logout', $controller.'@logout');
      $this->app->post($uri.'/refresh', $controller.'@refresh');
      $this->app->get($uri.'/me', $controller.'@me');
    }
```

You are welcome :)

Credits
=======

[](#credits)

- [Mahmoud Italy](https://github.com/Mahmoud-Italy)
- [All Contributors](https://github.com/Mahmoud-Italy/Lararoutes-lumen-custom-routes/graphs/contributors)

License
=======

[](#license)

The MIT License (MIT). Please see License File for more information.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity51

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

Every ~1 days

Total

2

Last Release

2108d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/17962343?v=4)[Mahmoud Ahmed](/maintainers/Mahmoud-Italy)[@Mahmoud-Italy](https://github.com/Mahmoud-Italy)

---

Top Contributors

[![Mahmoud-Italy](https://avatars.githubusercontent.com/u/17962343?v=4)](https://github.com/Mahmoud-Italy "Mahmoud-Italy (19 commits)")

---

Tags

apiresourceslararouteslumenresourcesroutesroutes-api

### Embed Badge

![Health badge](/badges/lararoutes-lumen-custom-routes/health.svg)

```
[![Health](https://phpackages.com/badges/lararoutes-lumen-custom-routes/health.svg)](https://phpackages.com/packages/lararoutes-lumen-custom-routes)
```

PHPackages © 2026

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