sadekd / laravel-request-id
Laravel Request ID
Installs: 1 439
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^8.1
- spatie/laravel-package-tools: ^1.13
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.