PHPackages                             tea-aroma/route-architect - 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. tea-aroma/route-architect

ActiveLibrary[Framework](/categories/framework)

tea-aroma/route-architect
=========================

Class-based route architecture for Laravel.

v1.0.0(1y ago)023MITPHPPHP ^8.2

Since Apr 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/tea-aroma/route-architect)[ Packagist](https://packagist.org/packages/tea-aroma/route-architect)[ RSS](/packages/tea-aroma-route-architect/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (16)Used By (0)

RouteArchitect
==============

[](#routearchitect)

**A clean, class-based system for organizing Laravel routes.**

Say goodbye to bloated `web.php` files. With `RouteArchitect`, you define routes as classes — reusable, composable, and auto-discoverable. Perfect for apps with complex structures, admin panels, or modular APIs.

Why RouteArchitect?
-------------------

[](#why-routearchitect)

- Keeps your `web.php` clean and maintainable.
- Supports deeply nested and reusable route groups.
- Generates route names, views, prefixes, and URLs automatically.
- Easily extendable, testable, and auto-discoverable.
- Ideal for complex apps with admin panels, modules, or APIs.

Example:
--------

[](#example)

```
class AdminRouteArchitect extends RouteArchitect
{
    protected string $identifier = 'admin';

    protected array $routeArchitects = [ DashboardRouteArchitect::class ];
}

// Generates route name: admin.dashboard
class DashboardRouteArchitect extends RouteArchitect
{
    protected string $identifier = 'dashboard';

    protected array | string | null $action = [ DashboardController::class, "index" ];
}

// In another controller...
return view(route_architect()->getSequenceEntry(DashboardRouteArchitect::class)->view);
```

---

Quick Start
-----------

[](#quick-start)

Install the package:

```
composer require tea-aroma/route-architect
```

Generate your first `RouteArchitect` class:

```
php artisan make:route-architect AdminRouteArchitect --identifier=admin
```

This command will create a new class in `app/RouteArchitects`:

```
namespace App\RouteArchitects;

use TeaAroma\RouteArchitect\Abstracts\RouteArchitect;

/**
 * AdminRouteArchitect.
 */
class AdminRouteArchitect extends RouteArchitect
{
    /**
     * The identifier.
     *
     * @var string
     */
    protected string $identifier = 'admin';
}
```

**Notice**: By default, the `identifier` is derived from the class name if not specified.

### Registering routes

[](#registering-routes)

- **Automatically** (default) — set `auto_scan = true` in the config.
- **Manually** — call `route_architect()->register()` with your `RouteArchitect` class.

```
// web.php

route_architect()->register(AdminRouteArchitect::class);
```

---

Configuration
-------------

[](#configuration)

You can publish the configuration file:

```
php artisan vendor:publish --provider="TeaAroma\RouteArchitect\Providers\RouteArchitectServiceProvider" --tag=config
```

Available options in `config/route-architect.php`:

OptionDescription`namespace`Base namespace for generated `RouteArchitect` classes.`directory`Base folder for generated `RouteArchitect` classes.`auto_scan`Automatically registers all `RouteArchitect` classes.`url_variable_template`Template for inserting route variables into URLs.`url_delimiter`Delimiter for URL segments.`url_segment_delimiter`Delimiter within individual URL segments.`route_name_delimiter`Delimiter for route name segments.`view_name_delimiter`Delimiter for view name segments.`action_delimiter`Delimiter between controller class and action method.`sequences_group_name_mode`Defines how the group name should be handled: `only-base` or `every-group`.---

Available properties
--------------------

[](#available-properties)

When you define your `RouteArchitect` class, you can configure it using the following properties:

PropertyDescription`identifier`Acts as a base for `name`, `view`, `url`, `prefix`, and `action` if they are null.`name`Route name segment.`view`View name segment.`prefix`URL prefix to apply for this and nested routes.`url`URL segment.`type`HTTP method.`action`Controller action.`controller`Controller class to apply for this and nested routes.`namespace`Namespace to apply for this and nested routes.`domain`Domain constraint.`customUrl`Custom URL, bypasses automatic generation.`middlewares`Middleware classes to apply.`excludeMiddlewares`Middleware classes to exclude.`routeArchitects`Nested `RouteArchitect` classes.`variables`Route parameters for URL.`autoScanRegisterMode`Controls auto-registration behavior during scan.`sequencesGroupName`Sequences group name to apply for this and nested routes.`registerMode`Defines how the route should be registered.---

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](https://github.com/tea-aroma/route-architect/blob/main/LICENSE.txt).

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance50

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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

Total

15

Last Release

367d ago

Major Versions

v0.4.0 → v1.0.02025-05-09

### Community

Maintainers

![](https://www.gravatar.com/avatar/439c08d30c1b50676d1b140f7fed8398f5664829fa257eedf42227a5324890d8?d=identicon)[tea-aroma](/maintainers/tea-aroma)

---

Top Contributors

[![tea-aroma](https://avatars.githubusercontent.com/u/114291088?v=4)](https://github.com/tea-aroma "tea-aroma (73 commits)")

---

Tags

frameworklaravelroutesArchitect

### Embed Badge

![Health badge](/badges/tea-aroma-route-architect/health.svg)

```
[![Health](https://phpackages.com/badges/tea-aroma-route-architect/health.svg)](https://phpackages.com/packages/tea-aroma-route-architect)
```

###  Alternatives

[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[laravel/wayfinder

Generate TypeScript representations of your Laravel actions and routes.

1.7k4.1M69](/packages/laravel-wayfinder)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k25.9M107](/packages/laravel-cashier)[laravel/boost

Laravel Boost accelerates AI-assisted development by providing the essential context and structure that AI needs to generate high-quality, Laravel-specific code.

3.4k10.6M274](/packages/laravel-boost)[laravel-zero/framework

The Laravel Zero Framework.

3371.4M369](/packages/laravel-zero-framework)[laravel/lumen-framework

The Laravel Lumen Framework.

1.5k26.2M708](/packages/laravel-lumen-framework)

PHPackages © 2026

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