PHPackages                             tushar/lazy-routing - 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. tushar/lazy-routing

ActiveLibrary[Framework](/categories/framework)

tushar/lazy-routing
===================

This is a Laravel library package once install you don't need to declare a route for each method instead you follow a normal camel case convention to declare the method name and the route will auto declared for you.

1.1.0(5y ago)014MITPHP

Since Jun 14Pushed 5y ago1 watchersCompare

[ Source](https://github.com/TusharSahaTonoy/lazy-routing-laravel)[ Packagist](https://packagist.org/packages/tushar/lazy-routing)[ Docs](https://github.com/TusharSahaTonoy/lazy-routing-laravel)[ RSS](/packages/tushar-lazy-routing/feed)WikiDiscussions master Synced 1mo ago

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

Lazy Routing
============

[](#lazy-routing)

A PHP laravel package for auto route declaration. After the installation user don't need to declare route in web.php file for each method.

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

[](#installation)

*Step 1:* In your laravel application composer require the package

```
composer require tushar/lazy-routing

```

*Step 2:* Publish the package.

```
php artisan vendor:publish --provider="Tushar\LazyRouting\LazyServiceProvider"

```

*Step 3:* Create a normal controller in app\\Http\\Controllers.

*Step 4:* Declare const LAZY\_CONFIG inside your controller class.

```
class  TestController  extends  Controller

{
	const  LAZY_CONFIG  = [
		"url_path" => "testy", //path prefix
		'route_generation' => true, // optional (default true)
	] ;
}

```

- Here **url\_path** is the route path prefix for this controller class. Like, in this example, the route will be created is

-&gt; [www.domain.com/testy/path-one](http://www.domain.com/testy/path-one)

-&gt; [www.domain.com/testy/path-two](http://www.domain.com/testy/path-two)

- **route\_generation** value is useful when you don't want to generate route for a specific controller. By default it is true and declaration of this variable is not mandatory.

Method Declaration
------------------

[](#method-declaration)

### Get Method

[](#get-method)

Put "get" in front of your method name to declare as get route. And use **camelCase** to declare your method name.

```
public  function  getGreatUser($user)
{
	return "Hello $user";
}

```

This method will generate a get route like (if "url\_path" =&gt; "testy")

url: domain.com/testey/greate-user/Jhon

route name: testy.getGreatUser \[format : url\_path.method\_full\_name\]

Result -&gt; Hello Jhon

### Post Method

[](#post-method)

Similar to the get method. Put “post” in front of your method name to declare as get route. And use **camelCase** to declare your method name.

```
public  function  postSaveUser(Request $request )
{
	return $request->all();
}

```

url: domain.com/testey/save-user

route name: testy.postSaveUser

#### If you don't put get or post in front of your method name route will not be generated for that method.

[](#if-you-dont-put-get-or-post-in-front-of-your-method-name-route-will-not-be-generated-for-that-method)

You can see artisan route list to verify your routes.

```
php artisan route:list

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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 ~70 days

Total

2

Last Release

2092d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/79b3d4e734062a8a19a811d82f6fc97475766ca9ab7221fea403e14bad3edf0c?d=identicon)[tonoysh](/maintainers/tonoysh)

---

Top Contributors

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

---

Tags

laravelpackageroutinglazyroutegenerationauto

### Embed Badge

![Health badge](/badges/tushar-lazy-routing/health.svg)

```
[![Health](https://phpackages.com/badges/tushar-lazy-routing/health.svg)](https://phpackages.com/packages/tushar-lazy-routing)
```

###  Alternatives

[pecee/simple-router

Simple, fast PHP router that is easy to get integrated and in almost any project. Heavily inspired by the Laravel router.

696214.6k17](/packages/pecee-simple-router)[izniburak/router

simple router class for php

23522.6k7](/packages/izniburak-router)[developermarius/simple-router

Simple, fast PHP router that is easy to get integrated and in almost any project. Heavily inspired by the Laravel router.

112.4k](/packages/developermarius-simple-router)

PHPackages © 2026

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