PHPackages                             los/request-id - 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. los/request-id

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

los/request-id
==============

PHP middleware to add a Request ID header

3.0.3(2y ago)552.9k2[1 PRs](https://github.com/Lansoweb/request-id/pulls)MITPHPPHP ^8.1

Since Nov 20Pushed 2y ago2 watchersCompare

[ Source](https://github.com/Lansoweb/request-id)[ Packagist](https://packagist.org/packages/los/request-id)[ Docs](https://github.com/lansoweb/request-id)[ GitHub Sponsors](https://github.com/Lansoweb)[ RSS](/packages/los-request-id/feed)WikiDiscussions 3.1.x Synced 1mo ago

READMEChangelog (5)Dependencies (10)Versions (21)Used By (0)

Request ID Middleware for PHP
=============================

[](#request-id-middleware-for-php)

This middleware adds a Request ID header that can be used to trace back requests (logs).

It uses \[Ramsey\\Uuid() library as default uuid generation.

Usage
-----

[](#usage)

Just add the middleware as one of the first in your application.

For example:

```
$app->pipe(new \LosMiddleware\RequestId\RequestId($options);
```

And the middleware will add a header to the request AND response

```
X-Request-Id: 56CEE969-4D3B-404E-9938-03E769E191CB

```

The options are:

- allow\_override: If it's allowed to override a previouly added request id header. Default: false
- header\_name: Header name. Default: X-Request-Id

### Laminas

[](#laminas)

If you are using [laminas-skeleton](https://github.com/laminas/laminas-skeleton), you can copy `config/los-request-id.global.php.dist` to `config/autoload/los-request-id.global.php` and modify configuration as your needs.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity81

Battle-tested with a long release history

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

Recently: every ~0 days

Total

12

Last Release

972d ago

Major Versions

0.9.0 → 1.0.02016-10-12

1.0.0 → 2.0.02018-03-16

2.1.x-dev → 3.0.02023-09-19

PHP version history (4 changes)0.9.0PHP ^5.5|^7.0

2.0.0PHP ^7.1

2.1.0PHP ^7.4 || ^8.0

3.0.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b54dffc1ebcb317a0cf825a781ab6c5f30980e9abd0d0a3f9c68830cb05c014?d=identicon)[Lansoweb](/maintainers/Lansoweb)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/los-request-id/health.svg)

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

###  Alternatives

[neos/flow

Flow Application Framework

862.0M451](/packages/neos-flow)[jaxon-php/jaxon-core

Jaxon is an open source PHP library for easily creating Ajax web applications

73142.3k25](/packages/jaxon-php-jaxon-core)[neos/flow-development-collection

Flow packages in a joined repository for pull requests.

144179.3k3](/packages/neos-flow-development-collection)[fisharebest/webtrees

webtrees online genealogy

73710.5k13](/packages/fisharebest-webtrees)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)[mezzio/mezzio-authentication

Authentication middleware for Mezzio and PSR-7 applications

121.6M26](/packages/mezzio-mezzio-authentication)

PHPackages © 2026

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