PHPackages                             raihel/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. raihel/controller

ActiveLibrary

raihel/controller
=================

Create your routes using attributes in your controllers

v0.2.1(3y ago)291MITPHPPHP ^8.1.0

Since Jul 13Pushed 3y agoCompare

[ Source](https://github.com/raihel/controller)[ Packagist](https://packagist.org/packages/raihel/controller)[ RSS](/packages/raihel-controller/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

Raihel Controller
=================

[](#raihel-controller)

[![Total Downloads](https://camo.githubusercontent.com/9a96f1e2bede898341e007f8d341183bdc456db56b5bd184b9d2cf20c8742ad1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f72616968656c2f636f6e74726f6c6c6572)](https://packagist.org/packages/raihel/controller)[![Latest Stable Version](https://camo.githubusercontent.com/22f3afbb9de241385f36d62d4675baba5c24d03ec0c04b5b9da4c6628b4f56e5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72616968656c2f636f6e74726f6c6c6572)](https://packagist.org/packages/raihel/controller)[![License](https://camo.githubusercontent.com/d221261d640eef505615506fb3f50661db4c6dd72ce36e1ca5203119ccd99f2c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f72616968656c2f636f6e74726f6c6c6572)](https://packagist.org/packages/raihel/controller)

Create your routes using attributes in your controllers

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

[](#installation)

```
  composer install raihel/controller
```

Setting
-------

[](#setting)

Use Controller Factory to map your routes

- `diretory`: An array with the directories of your controllers
- `controllers`: An array with your controller classes
- `loadRoute`: The class that will do the work of including the routes mapped in your controllers in your application accepts any class that implements `Raihel\Controller\Core\Load\Type\LoudRoute`

### Slim:

[](#slim)

```
require __DIR__.'/../../vendor/autoload.php';

use App\HelloController;
use Raihel\Controller\Core\ControllerFactory;
use Slim\App;

$app = new App();

use Raihel\Controller\Core\Load\Type\SlimLoadRoute;

ControllerFactory::load(
  loadRoute: new SlimLoadRoute($app),
  diretory: [__DIR__ . '/../src'],
  controllers: [HelloController::class]
);

$app->run();
```

### Lumen:

[](#lumen)

```
ControllerFactory::load(
    loadRoute: new LumenLoadRoute($router),
    diretory: [__DIR__ . '/../app/Http/Controllers'],
);
```

Usage/Examples
--------------

[](#usageexamples)

### Controller

[](#controller)

Create your controller by adding the attribute Controller in your class it can receive a prefix that groups your routes

```
namespace App;

use Raihel\Controller\Attributes\Controller;
use Raihel\Controller\Attributes\Route\Get;
use Raihel\Controller\Attributes\Route\Put;

#[Controller('home')]
class AppController
{
    #[Get]
    public function home()
    {
        echo 'Hello World!';
    }

    #[Get('hello'), Put('hello')]
    public function get2()
    {
        echo 'Hello World 2!';
    }
}
```

### Routes

[](#routes)

The attribute `Get` before the home method creates a `GET /home` endponit for application

AttributesGetPostPutDeletePatchAuthors
-------

[](#authors)

- [@heliodantas](https://github.com/HelioDantas)

License
-------

[](#license)

The Raihel Controller is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

Total

3

Last Release

1405d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cfd88f078d95f48a3ca4ebf4a367a3a875eb4c85a2ba7f6db5a3a0492c1de1b0?d=identicon)[Heliodantas](/maintainers/Heliodantas)

---

Top Contributors

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

---

Tags

routerslimattributescontrollerphp8

### Embed Badge

![Health badge](/badges/raihel-controller/health.svg)

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

###  Alternatives

[tommyknocker/pdo-database-class

Framework-agnostic PHP database library with unified API for MySQL, MariaDB, PostgreSQL, SQLite, MSSQL, and Oracle. Query Builder, caching, sharding, window functions, CTEs, JSON, migrations, ActiveRecord, CLI tools, AI-powered analysis. Zero external dependencies.

845.7k](/packages/tommyknocker-pdo-database-class)[uderline/openapi-php-attributes

Automatically render your OpenApi 3 file describing your PHP API using attributes

2136.3k](/packages/uderline-openapi-php-attributes)[shahghasiadil/laravel-api-versioning

Elegant attribute-based API versioning solution for Laravel applications with built-in deprecation management and version inheritance

2913.6k](/packages/shahghasiadil-laravel-api-versioning)[martynbiz/slim3-controller

Provides controller functionality to Slim Framework v3. Also includes PHPUnit TestCase for testing controllers.

2814.4k1](/packages/martynbiz-slim3-controller)[saeven/zf3-circlical-autowire

Annotation based routing, and magic Controller creation for Laminas and ZF3.

1430.0k](/packages/saeven-zf3-circlical-autowire)

PHPackages © 2026

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