sadekd/laravel-request-id

Laravel Request ID

v1.0.1 2023-09-12 14:15 UTC

This package is auto-updated.

Last update: 2024-04-12 15:27:11 UTC


README

This Laravel package to help you add X-Request-ID feature into your Laravel app

The HTTP X-Request-ID request header is an optional and unofficial HTTP header, used to trace individual HTTP requests from the client to the server and back again. It allows the client and server to correlate each HTTP request.

Installation

composer require sadekd/laravel-request-id

Config

php artisan vendor:publish --provider="SadekD\LaravelRequestId\LaravelRequestIdServiceProvider"

Configuration is commented in the config file

Usage

Edit App\Http\Kernel.php and add it as middleware into any stack or use it single (overall higher is better - in case of fail, you have XRID in logs, response, etc.)

protected $middleware = [
    \SadekD\LaravelRequestId\Http\Middleware\RequestId::class,
     // or just 'request-id',
];

License

The MIT License (MIT). Please see License File for more information.