PHPackages                             grummfy/laravel-route-controller - 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. grummfy/laravel-route-controller

ActiveLibrary

grummfy/laravel-route-controller
================================

Define Router::controller() without breaking everything

1.0.0(8y ago)23.5k1MITPHP

Since Feb 6Pushed 8y ago1 watchersCompare

[ Source](https://github.com/Grummfy/laravel-route-controller)[ Packagist](https://packagist.org/packages/grummfy/laravel-route-controller)[ RSS](/packages/grummfy-laravel-route-controller/feed)WikiDiscussions master Synced 2mo ago

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

Laravel route controller
========================

[](#laravel-route-controller)

This library like other existing, give a way to deal with `Router::controller`. The key features:

- allow caching of route
- doesn't require extra manipulation
- allow inheritance of route group
- namespace independent

Compatible with laravel 5.5. (probably compatible with older version too).

Install
-------

[](#install)

Install the dependencies

```
composer require grummfy/laravel-route-controller

```

Publish the configuration

```
php artisan vendor:publish --tag=config --provider=Grummfy\LaravelRouteController\RouteControllerProvider

```

Usage
-----

[](#usage)

Once the package is install and autodiscover (or you have added the provider manually), the package is ready to use.

In your route file, just do this:

```
Route::controller('/foo', \App\Http\Controllers\FooController::class);

```

It will take all the public method from the class (including traits) and convert it to route.

There is a third argument that you can use to add extra option, like a middleware or anything else.

```
Route::controller('/foo', \App\Http\Controllers\FooController::class, ['middleware' => 'can:baz']);

```

You got also an extra option, to don't allow heritance of methods from parent:

```
Route::controller('/foo', \App\Http\Controllers\FooController::class, ['middleware' => 'can:baz', 'heritage' => false]);

```

### Example

[](#example)

Imagine that we have the class FooController (see [example](example/FooController.php)), in this case we will have a series of method that will be converted to routes:

- index() -&gt; /foo, foo.index
- getStatus(string $status) -&gt; /foo/status/{status}, foo.status.post
- postStatus(string $status) -&gt; /foo/status/{status}, foo.status.get
- foo() -&gt; /foo/foo, foo.foo
- my() -&gt; /foo/my, foo.my

TODO
----

[](#todo)

- unit test
- QA tools
    - travis
    - styleci
    - scrutinizer
    - ...

Alternative
-----------

[](#alternative)

-
-
-
-
-
- ...

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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

3014d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/668804?v=4)[Grummfy](/maintainers/Grummfy)[@Grummfy](https://github.com/Grummfy)

---

Top Contributors

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

---

Tags

laravelcontrollerroute

### Embed Badge

![Health badge](/badges/grummfy-laravel-route-controller/health.svg)

```
[![Health](https://phpackages.com/badges/grummfy-laravel-route-controller/health.svg)](https://phpackages.com/packages/grummfy-laravel-route-controller)
```

###  Alternatives

[illuminatech/url-trailing-slash

Allows enforcing URL routes with or without trailing slash

50216.9k](/packages/illuminatech-url-trailing-slash)[renoki-co/laravel-healthchecks

Laravel Healthchecks is a simple controller class that helps you build your own healthchecks endpoint without issues.

5654.9k](/packages/renoki-co-laravel-healthchecks)[yzen.dev/laravel-route-coverage

Laravel route coverage

213.8k](/packages/yzendev-laravel-route-coverage)[illuminatech/model-route

Allows continuing route matching in case bound model does not exist

121.2k](/packages/illuminatech-model-route)

PHPackages © 2026

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