lara-middleware / response-time
Laravel 5 Response Time Middleware
Installs: 1 754
Dependents: 0
Suggesters: 0
Security: 0
Stars: 9
Watchers: 2
Forks: 2
Open Issues: 0
Requires
- php: >=5.4
- illuminate/contracts: ~5.0
Requires (Dev)
- illuminate/http: ~5.1@dev
- phpspec/phpspec: ~2.0
This package is not auto-updated.
Last update: 2024-12-25 08:48:02 UTC
README
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