PHPackages                             irealworlds/laravel-attribute-requests - 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. irealworlds/laravel-attribute-requests

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

irealworlds/laravel-attribute-requests
======================================

v0.0.2(3y ago)16

Since Jun 29Compare

[ Source](https://github.com/iRealWorlds/laravel-attribute-requests)[ Packagist](https://packagist.org/packages/irealworlds/laravel-attribute-requests)[ RSS](/packages/irealworlds-laravel-attribute-requests/feed)WikiDiscussions Synced 3d ago

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

Laravel Attribute Requests
==========================

[](#laravel-attribute-requests)

[![Tests](https://github.com/iRealWorlds/laravel-attribute-requests/actions/workflows/run_tests.yml/badge.svg)](https://github.com/iRealWorlds/laravel-attribute-requests/actions/workflows/run_tests.yml)[![StyleCI](https://camo.githubusercontent.com/6873cd27100d0b5fe01f4e374012a5b264d3bde51049fcb3ebedda227b0af2d6/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3636303136333238322f736869656c643f6272616e63683d6d6173746572267374796c653d706c6173746963)](https://github.styleci.io/repos/660163282?branch=master&style=plastic)[![Packagist Version)](https://camo.githubusercontent.com/7ca526e16824852d5db95e3f45ba2e8724f4bed041a3d2be64d7cfb2fe65a545/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f697265616c776f726c64732f6c61726176656c2d6174747269627574652d7265717565737473)](https://camo.githubusercontent.com/7ca526e16824852d5db95e3f45ba2e8724f4bed041a3d2be64d7cfb2fe65a545/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f697265616c776f726c64732f6c61726176656c2d6174747269627574652d7265717565737473)

About
-----

[](#about)

The Laravel Attribute Requests Package simplifies the process of handling and validating incoming requests by introducing the concept of Data Transfer Objects (DTOs). With this package, you can define request DTOs using attributes, making it easier to validate and process the input.

Instead of working directly with arrays and magic strings when consuming and validating requests, you can define dedicated DTO classes for each specific request, encapsulating all the required input fields and validation rules related to that request. This approach helps improve the maintainability, readability, and testability of your codebase, while also easing development by helping IDEs provide useful hints while you develop.

This way, you can leverage the power of PHP's type hinting to enforce the type of each attribute, preventing potential type-related errors. Moreover, you can apply validation expressively, using PHP attributes with Laravel's built-in and custom validation rules.

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

[](#installation)

You can add this package through composer, using the require command:

```
composer require irealworlds/laravel-attribute-requests
```

If you want to modify the configuration file, you can first publish it using the `vendor:publish` command:

```
php artisan vendor:publish --tag=configuration --provider=AttributeRequestServiceProvider
```

Example Usage
-------------

[](#example-usage)

Defining requests is as simple as creating a class and decorating its properties for validation. For example:

```
use Ireal\AttributeRequests\Http\Request;

class PostStoreRequest extends Request
{
    public string $title;
    public string|null $body;
}
```

And then consuming it:

```
public function store(PostStoreRequest $request)
{
    $post = Post::query()->create([
        'title' => $request->title, // IDE knows exactly what type of variable $request->title is here
        'body' => $request->body
    ]);
}
```

While the usage is similar to what you could do in Laravel by default, there are certain advantages to this approach. For example:

- **Strong Typing:** Leverage the power of PHP's type hinting to enforce the type of each attribute, preventing potential type-related errors.
- **Automatic Validation:** The package automatically validates incoming requests based on the defined DTO rules, reducing the need for manual validation code. [More on validation](https://github.com/iRealWorlds/laravel-attribute-requests/wiki/Validation)
- **Compatibility:** The package is designed to work seamlessly with Laravel, leveraging its features and conventions.
- **IDE hinting:** Using this type of writing requests helps IDEs know what type of properties you are expecting, allowing them to help you when developing and enabling refactoring to be that much easier.

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

[](#documentation)

You can read the full documentation on the [package's wiki page](https://github.com/iRealWorlds/laravel-attribute-requests/wiki).

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 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

2

Last Release

1102d ago

### Community

Maintainers

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

---

Top Contributors

[![irealworlds](https://avatars.githubusercontent.com/u/28299559?v=4)](https://github.com/irealworlds "irealworlds (29 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/irealworlds-laravel-attribute-requests/health.svg)

```
[![Health](https://phpackages.com/badges/irealworlds-laravel-attribute-requests/health.svg)](https://phpackages.com/packages/irealworlds-laravel-attribute-requests)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M151](/packages/laravel-mcp)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[api-platform/laravel

API Platform support for Laravel

58171.8k14](/packages/api-platform-laravel)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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