lara-middleware/request-id

Laravel 5 RequestId Middleware

dev-master 2015-03-11 18:09 UTC

This package is not auto-updated.

Last update: 2024-12-25 07:50:47 UTC


README

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