PHPackages                             hosamaldeen/auto\_route - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. hosamaldeen/auto\_route

ActiveLaravel[Utility &amp; Helpers](/categories/utility)

hosamaldeen/auto\_route
=======================

laravel General Route : to allow You not to put every general route in the route file

07PHP

Since Oct 31Pushed 8y ago1 watchersCompare

[ Source](https://github.com/hosamaldeen/auto_route)[ Packagist](https://packagist.org/packages/hosamaldeen/auto_route)[ RSS](/packages/hosamaldeen-auto-route/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

laravel auto route
==================

[](#laravel-auto-route)

laravel General Route to allow You not to put every general route in the route file

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

[](#installation)

run this command `composer require hosamaldeen/auto_route`

Route Rules
===========

[](#route-rules)

there are 4 ways for general routes based on the count of the segments

- Urls that include 1 segments like **/product**
    will request **ProductController@index**
- Urls that include 2 segments **/product/all**
    will request **ProductController@all**
- Urls that include 2 segments and the second segment is number like **/product/1**
    will request **ProductController@view**
    and pass the value to the function as {id}
- Urls that include 3 segments **/product/search/1**
    will request **ProductController@search**
    and pass the value to the function as {id}

Usage
=====

[](#usage)

in your route file add this

```
$defaultRoute = new HosamAldeen\AutoRoute\Route;
$defaultRoute->create();

```

you can add some options to your routes

```
$defaultRoute = new HosamAldeen\AutoRoute\Route;
$defaultRoute->prefix = '';
$defaultRoute->middleware = [];
$defaultRoute->namespace = '';
$defaultRoute->create();

```

Full Example
============

[](#full-example)

```
$defaultRoute = new HosamAldeen\AutoRoute\Route; // frontend
$defaultRoute->create();

$defaultRoute = new HosamAldeen\AutoRoute\Route; //backend
$defaultRoute->prefix = '/backend';
$defaultRoute->middleware = ['web'];
$defaultRoute->namespace = 'Backend';
$defaultRoute->create();

```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/29a08f0cbc478a4278998821d07f8eb1aec2cf7432e817283c33dad7d5da0e70?d=identicon)[hosamaldeen](/maintainers/hosamaldeen)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/hosamaldeen-auto-route/health.svg)

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

###  Alternatives

[d4l/kirby-static-site-generator

Static site generator plugin for Kirby 3+

14313.1k](/packages/d4l-kirby-static-site-generator)[aeon-php/rate-limiter

Aeon rate limiter (throttling) library

10142.9k1](/packages/aeon-php-rate-limiter)

PHPackages © 2026

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