PHPackages                             gouh/laminas-handlers - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. gouh/laminas-handlers

ActiveLibrary[HTTP &amp; Networking](/categories/http)

gouh/laminas-handlers
=====================

JsonResponse implementation of laminas/diactoros with a structured data and Data Transfer Object class.

1.0.1(4y ago)06MITPHPPHP ^7.3

Since May 20Pushed 4y ago1 watchersCompare

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

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

laminas-handlers
================

[](#laminas-handlers)

JsonResponse implementation of laminas/diactoros with a structured data and Data Transfer Object class.

### Built With

[](#built-with)

- [PHP](https://www.php.net)
- [Diactoros](https://docs.laminas.dev/laminas-diactoros)
- [http-status](https://github.com/lukasoppermann/http-status)
- [http-message-util](https://github.com/php-fig/http-message-util)

### Usage

[](#usage)

You can use class JsonResponse for produce ResponseInterface

```
use StructuredHandlers\JsonResponse;
```

then you can use like this, produces a response 200 by default

```
return new JsonResponse(
        $responseData,
        'This is a cool message'
);
```

Or in a more specific case something like this

```
return new JsonResponse(
        $responseData, // Data to client
        'This is a bad message', // Personalized message
        500, // Http status code
        true, // is error
        $arrayHeaders // Array of headers
);
```

You can use class DataTransferObject for extends in your DTO

```
class MyDtoRequest extends DataTransferObject {
    public $className;
    public $version;
    public $property;
}
```

To construct an object of the class, an array can be used thanks to the use of reflection in DataTransferObject class

```
$myDtoArray = [
    'className' => 'Example',
    'version' => 1.0,
    'property' => 'hi!'
];

$myDto = new MyDtoRequest($myDtoArray);
```

You can build an array based on a single value or also excluding some value from the entire class

```
$myDto->only('className')->toArray();
```

Only get class\_name, the names are obtained in snake case if the false parameter is not specified to the toArray function

```
[
    'class_name' => 'Example'
]
```

You can exclude a property from the class using the except function

```
$myDto->except('className')->toArray();
```

produces

```
[
    'class_name' => 'Example',
    'property' => 'hi!'
]
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

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

2

Last Release

1818d ago

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/gouh-laminas-handlers/health.svg)

```
[![Health](https://phpackages.com/badges/gouh-laminas-handlers/health.svg)](https://phpackages.com/packages/gouh-laminas-handlers)
```

###  Alternatives

[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)[mezzio/mezzio

PSR-15 Middleware Microframework

3883.6M97](/packages/mezzio-mezzio)[laminas/laminas-stratigility

PSR-7 middleware foundation for building and dispatching middleware pipelines

586.6M81](/packages/laminas-laminas-stratigility)[laminas/laminas-psr7bridge

Bidirectional conversions between PSR-7 and laminas-http messages

117.9M18](/packages/laminas-laminas-psr7bridge)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.0M61](/packages/mezzio-mezzio-router)[mimmi20/browser-detector

Library to detect Browsers and Devices

48153.5k3](/packages/mimmi20-browser-detector)

PHPackages © 2026

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