Download the PHP package dotkernel/dot-response-header without Composer
On this page you can find all versions of the php package dotkernel/dot-response-header. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dotkernel/dot-response-header
More information about dotkernel/dot-response-header
Files in dotkernel/dot-response-header
Package dot-response-header
Short Description Dotkernel middleware for setting custom response headers.
License MIT
Homepage https://github.com/dotkernel/dot-response-header
Informations about the package dot-response-header
dot-response-header
dot-response-header
is Dotkernel's middleware for setting and overwriting custom response headers.
Documentation
Documentation is available at: https://docs.dotkernel.org/dot-response-header/.
Badges
Requirements
- PHP: 8.1, 8.2, 8.3 or 8.4
Installation
Run the following command in your project root directory:
Next, register the package's ConfigProvider
to your application config.
Make sure to register the package under the
// DK packages
section.
After registering the package, add it to the middleware stack in config/pipeline.php
after $app->pipe(RouteMiddleware::class);
Create a new file response-header.global.php
in config/autoload
with the below configuration array:
Because headers are matched with route names, we can have custom response headers for every request, by defining new headers under the *
key.
All headers under *
will be set for every response.
To add response headers for a specific set of routes, define a new array using the route name as the array key.
Example:
To overwrite an existing header use overwrite => true
.
All versions of dot-response-header with dependencies
mezzio/mezzio-router Version ^3.16
psr/http-client Version ^1.0
psr/http-message Version ^1.0 || ^2.0