PHPackages                             proemergotech/correlate-php-laravel - 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. proemergotech/correlate-php-laravel

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

proemergotech/correlate-php-laravel
===================================

Middleware to handle incoming correlation id header for Laravel and Lumen

1.0.1(8y ago)23.2k1MITPHP

Since Feb 2Pushed 8y ago3 watchersCompare

[ Source](https://github.com/proemergotech/correlate-php-laravel)[ Packagist](https://packagist.org/packages/proemergotech/correlate-php-laravel)[ Docs](https://github.com/proemergotech/correlate-php-core)[ RSS](/packages/proemergotech-correlate-php-laravel/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (9)Versions (3)Used By (0)

correlate-php-laravel
=====================

[](#correlate-php-laravel)

---

Overview
--------

[](#overview)

It's very difficult to track a request across the system when we are working with microservices. We came out with a solution for that. We generate a unique version 4 uuid for every request and every service passes this id via request headers to other services. We call this **correlation ID**.

Packages
--------

[](#packages)

- [proemergotech/correlate-php-laravel](https://github.com/proemergotech/correlate-php-laravel)
    - Middleware for Laravel and Lumen frameworks.
- [proemergotech/correlate-php-psr-7](https://github.com/proemergotech/correlate-php-psr-7)
    - Middleware for any PSR-7 compatible frameworks like [Slim Framework](https://www.slimframework.com/).
- [proemergotech/correlate-php-monolog](https://github.com/proemergotech/correlate-php-monolog)
    - Monolog processor for correlate middlewares (you don't have to use this directly).
- [proemergotech/correlate-php-guzzle](https://github.com/proemergotech/correlate-php-guzzle)
    - Guzzle middleware to add correlation id to every requests.
- [proemergotech/correlate-php-core](https://github.com/proemergotech/correlate-php-core)
    - Common package for correlate id middlewares to provide consistent header naming accross projects.

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

[](#installation)

- Install via composer

```
composer require proemergotech/correlate-php-laravel
```

Setup for Laravel 5
-------------------

[](#setup-for-laravel-5)

Add the `ProEmergotech\Correlate\Laravel\LaravelCorrelateMiddleware` middleware to the $middleware property of your app/Http/Kernel.php class.

Setup for Lumen 5
-----------------

[](#setup-for-lumen-5)

Add service provider to bootstrap/app.php in your Lumen project.

```
// bootstrap/app.php

$app->register(\ProEmergotech\Correlate\Laravel\LaravelCorrelateServiceProvider::class);
```

Usage
-----

[](#usage)

This middleware automatically adds correlation id (coming from request header) to every log message. There are some macros added to the request object if you want to work with correlation id.

Using macros via request object:

```
if ($request->hasCorrelationId()) {
  $cid = $request->getCorrelationId();
}
// or if you can change the ID
$request->setCorrelationId(\ProEmergotech\Correlate\Correlate::id());
```

Contributing
------------

[](#contributing)

See `CONTRIBUTING.md` file.

Credits
-------

[](#credits)

This package was developed by [Soma Szélpál](https://github.com/shakahl/) at [Pro Emergotech Ltd.](https://github.com/proemergotech/).

Additional author is [Miklós Boros](https://github.com/cherubmiki) at [Pro Emergotech Ltd.](https://github.com/proemergotech/).

License
-------

[](#license)

This project is released under the [MIT License](http://www.opensource.org/licenses/MIT).

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 90.9% 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

Unknown

Total

1

Last Release

3064d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5264395?v=4)[Soma Szelpal](/maintainers/shakahl)[@shakahl](https://github.com/shakahl)

---

Top Contributors

[![shakahl](https://avatars.githubusercontent.com/u/5264395?v=4)](https://github.com/shakahl "shakahl (10 commits)")[![cherubmiki](https://avatars.githubusercontent.com/u/12793108?v=4)](https://github.com/cherubmiki "cherubmiki (1 commits)")

---

Tags

psr-7loglaravelslimlumenuuiddispatcherMicroservicecorrelate

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/proemergotech-correlate-php-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/proemergotech-correlate-php-laravel/health.svg)](https://phpackages.com/packages/proemergotech-correlate-php-laravel)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k532.1M19.4k](/packages/laravel-framework)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.6k38.2k](/packages/matomo-matomo)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[onlime/laravel-http-client-global-logger

A global logger for the Laravel HTTP Client

2037.5k](/packages/onlime-laravel-http-client-global-logger)[api-platform/laravel

API Platform support for Laravel

59156.3k11](/packages/api-platform-laravel)[neomerx/cors-illuminate

CORS (Cross-Origin Resource Sharing) support for Laravel and Lumen

4896.8k2](/packages/neomerx-cors-illuminate)

PHPackages © 2026

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