lara-middleware/response-time

Laravel 5 Response Time Middleware

0.1.0 2015-03-11 17:17 UTC

This package is not auto-updated.

Last update: 2024-11-13 08:19:25 UTC


README

Packagist version Build Status

Set X-Response-Time to response header

Install

$ composer require lara-middleware/response-time

or add

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

to package.json > "require"

Usage

For all routes

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

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

For specific routes

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

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

Then, use with routes:

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

License

MIT © C. T. Lin