Download the PHP package creativeorange/laravel-served-by without Composer
On this page you can find all versions of the php package creativeorange/laravel-served-by. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download creativeorange/laravel-served-by
More information about creativeorange/laravel-served-by
Files in creativeorange/laravel-served-by
Package laravel-served-by
Short Description Automatically set the Served By for requests in your Laravel Framework.
License MIT
Homepage https://github.com/creativeorange/served-by
Informations about the package laravel-served-by
Laravel Served By
Useful middleware for Laravel Requests & Jobs to determine which server is serving (or running) the request. For HTTP requests, the identifier string will be sent back as HTTP Header "X-Served-By". In jobs, it is possible to send Context to Flare, or tag the server in Horizon.
Installation
You can install the package via composer:
For Laravel 8 or lower please install version 1.
Usage HTTP requests
To allow Served By for all your routes, add the ServedBy middleware at the top of the $middleware property of app/Http/Kernel.php class:
Flare
If you use Flare, you can add the following to your job(s):
Configuration
The defaults are set in config/served-by.php. Publish the config to copy the file to your own config:
By default, you can also overwrite the identifier string by adding to your .env
Credits
- Creativeorange B.V.
- All Contributors
License
The MIT License (MIT). Please see License File for more information.