PHPackages                             solophp/request-handler - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. solophp/request-handler

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

solophp/request-handler
=======================

Robust request validation &amp; authorization layer for HTTP inputs with type-safe handlers and modern PHP 8+ architecture

v3.0.0(1mo ago)046MITPHPPHP ^8.2CI passing

Since Sep 24Pushed 1mo agoCompare

[ Source](https://github.com/SoloPHP/Request-Handler)[ Packagist](https://packagist.org/packages/solophp/request-handler)[ RSS](/packages/solophp-request-handler/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)Dependencies (5)Versions (9)Used By (0)

Solo Request Handler
====================

[](#solo-request-handler)

Type-safe Request DTOs for PHP 8.2+ with automatic validation, type casting, and full IDE support.

[![Latest Version on Packagist](https://camo.githubusercontent.com/cf6b1e4e9b692f219e71597d621804b86a65cf8eb9b9bcd6fb4039b7b021d80c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736f6c6f7068702f726571756573742d68616e646c65722e737667)](https://packagist.org/packages/solophp/request-handler)[![PHP Version](https://camo.githubusercontent.com/9051b6544f57608ca691a918b38ad8c567657e0ecb6d4e960be274f287d171d8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322532422d3838393242462e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](LICENSE)

Features
--------

[](#features)

- **Attribute-based DTOs** — Define request structures using `#[Field]` attributes
- **Automatic Type Casting** — Built-in support for int, float, bool, string, array, DateTime
- **Validation Rules** — Expressive rules with route parameter placeholders
- **Generators** — Auto-generate UUIDs, sequences, and custom values
- **Pre/Post Processing** — Transform data before validation or after casting
- **Nested Items** — Validate arrays of nested objects through referenced Request classes
- **Field Grouping** — Organize fields into logical groups

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

[](#installation)

```
composer require solophp/request-handler
```

Quick Example
-------------

[](#quick-example)

```
use Solo\RequestHandler\Attributes\Field;
use Solo\RequestHandler\Request;

final class CreateProductRequest extends Request
{
    #[Field(rules: 'required|string|max:255')]
    public string $name;

    #[Field(rules: 'required|numeric|min:0')]
    public float $price;

    #[Field(rules: 'nullable|integer|min:0')]
    public int $stock = 0;

    #[Field(generator: UuidGenerator::class)]
    public string $id;
}

// In controller (POST/PUT/PATCH — from request body)
$dto = $requestHandler->handleBody(CreateProductRequest::class, $request);

// For GET requests — from query parameters
// $dto = $requestHandler->handleQuery(SearchRequest::class, $request);

$dto->name;   // string - full IDE support
$dto->price;  // float - auto-casted
$dto->id;     // string - auto-generated UUID
```

Documentation
-------------

[](#documentation)

**[Full Documentation](https://solophp.github.io/Request-Handler/)**

- [Installation](https://solophp.github.io/Request-Handler/guide/installation)
- [Quick Start](https://solophp.github.io/Request-Handler/guide/quick-start)
- [Field Attribute](https://solophp.github.io/Request-Handler/features/field-attribute)
- [Type Casting](https://solophp.github.io/Request-Handler/features/type-casting)
- [Processors](https://solophp.github.io/Request-Handler/features/processors)
- [Generators](https://solophp.github.io/Request-Handler/features/generators)
- [Nested Items](https://solophp.github.io/Request-Handler/features/nested-items)
- [Validation](https://solophp.github.io/Request-Handler/features/validation)
- [API Reference](https://solophp.github.io/Request-Handler/api/request-class)

Requirements
------------

[](#requirements)

- PHP 8.2+
- PSR-7 HTTP Message implementation
- Validator implementing `Solo\Contracts\Validator\ValidatorInterface`

We recommend [solophp/validator](https://github.com/SoloPHP/Validator).

License
-------

[](#license)

MIT License. See [LICENSE](LICENSE) for details.

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance91

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity53

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

Recently: every ~36 days

Total

8

Last Release

43d ago

Major Versions

v1.2.0 → v2.0.02025-12-29

v2.2.0 → v3.0.02026-04-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/2f29817cec408d033cd4441c8f760e3ae40248dc0f66856a09080d282aee6959?d=identicon)[Vitaliy Olos](/maintainers/Vitaliy%20Olos)

---

Top Contributors

[![SoloPHP](https://avatars.githubusercontent.com/u/175482616?v=4)](https://github.com/SoloPHP "SoloPHP (34 commits)")

---

Tags

requestpsrphpvalidationprocessingauthorizationformphp8strict types

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/solophp-request-handler/health.svg)

```
[![Health](https://phpackages.com/badges/solophp-request-handler/health.svg)](https://phpackages.com/packages/solophp-request-handler)
```

###  Alternatives

[santigarcor/laratrust

This package provides a flexible way to add Role-based Permissions to Laravel

2.3k5.4M43](/packages/santigarcor-laratrust)[andalisolutions/oauth2-anaf

Anaf OAuth 2.0 support for the PHP League's OAuth 2.0 Client

194.1k](/packages/andalisolutions-oauth2-anaf)

PHPackages © 2026

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