lara-middleware / request-id by chentsulin

Laravel 5 RequestId Middleware
14
2
2
Package Data
Maintainer Username: chentsulin
Package Create Date: 2015-03-10
Package Last Update: 2016-11-02
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-06-16 15:02:15
Package Statistics
Total Downloads: 14
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 2
Total Watchers: 2
Total Forks: 1
Total Open Issues: 1

request-id

Packagist version Build Status

Set X-Response-Time to response header

Install

$ composer require lara-middleware/request-id

or add

"lara-middleware/response-time": "dev-master"

to package.json > "require"

Usage

For all routes

Add 'LaraMiddleware\RequestId\RequestId' as Kernel's first middleware:

// app/Http/Kernel.php
protected $middleware = [
	'LaraMiddleware\RequestId\RequestId',
	....
]

For specific routes

Add 'response-time' => 'LaraMiddleware\RequestId\RequestId', to route middleware:

// app/Http/Kernel.php
protected $routeMiddleware = [
	'response-time' => 'LaraMiddleware\RequestId\RequestId',
	....
]

Then, use with routes:

Route::get('some-specific', ['middleware' => 'request-id', function()
{
    //
}]);

License

MIT © C. T. Lin