Next, register the package's ConfigProvider
to your application config.
Dot\ResponseHeader\ConfigProvider::class,
Note : 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);
$app->pipe(RouteMiddleware::class);
$app->pipe(\Dot\ResponseHeader\Middleware\ResponseHeaderMiddleware::class);
Create a new file response-header.global.php
in config/autoload
with the below configuration array :
<?php
return [
'dot_response_headers' => [
'*' => [
'CustomHeader1' => [
'value' => 'CustomHeader1-Value',
'overwrite' => true,
],
'CustomHeader2' => [
'value' => 'CustomHeader2-Value',
'overwrite' => false,
],
],
'home' => [
'CustomHeader' => [
'value' => 'header3',
]
],
'login' => [
'LoginHeader' => [
'value' => 'LoginHeader-Value',
'overwrite' => false
]
],
]
];