Skip to content

Commit

Permalink
Changed line separators for files
Browse files Browse the repository at this point in the history
  • Loading branch information
PopNatanael committed Apr 16, 2024
1 parent 8c59ed9 commit adfd94e
Show file tree
Hide file tree
Showing 7 changed files with 117 additions and 117 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: "Continuous Integration"

on:
pull_request:
push:
branches:
tags:

jobs:
ci:
uses: laminas/workflow-continuous-integration/.github/workflows/[email protected]
name: "Continuous Integration"

on:
pull_request:
push:
branches:
tags:

jobs:
ci:
uses: laminas/workflow-continuous-integration/.github/workflows/[email protected]
32 changes: 16 additions & 16 deletions .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: docs-build

on:
release:
types: [published]
workflow_dispatch:

jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- name: Build Docs
uses: dotkernel/documentation-theme/github-actions/docs@main
env:
DEPLOY_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: docs-build

on:
release:
types: [published]
workflow_dispatch:

jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- name: Build Docs
uses: dotkernel/documentation-theme/github-actions/docs@main
env:
DEPLOY_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion docs/book/index.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
../../README.md
../../README.md
114 changes: 57 additions & 57 deletions docs/book/v3/configuration.md
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
# Configuration

## Requirements

- PHP >= 8.1

## Register ConfigProvider

Next, register the package's `ConfigProvider` to your application config.

```php
Dot\ResponseHeader\ConfigProvider::class,
```

Note : Make sure to register the package under the `// DK packages` section.

## Add the package to the middleware stack

After registering the package, add it to the middleware stack in `config/pipeline.php` after `$app->pipe(RouteMiddleware::class);`

```php
$app->pipe(RouteMiddleware::class);
$app->pipe(\Dot\ResponseHeader\Middleware\ResponseHeaderMiddleware::class);
```

## Add configuration in autoload

Create a new file `response-header.global.php` in `config/autoload` with the below configuration array :

```php
<?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
]
],
]
];
```
# Configuration

## Requirements

- PHP >= 8.1

## Register ConfigProvider

Next, register the package's `ConfigProvider` to your application config.

```php
Dot\ResponseHeader\ConfigProvider::class,
```

Note : Make sure to register the package under the `// DK packages` section.

## Add the package to the middleware stack

After registering the package, add it to the middleware stack in `config/pipeline.php` after `$app->pipe(RouteMiddleware::class);`

```php
$app->pipe(RouteMiddleware::class);
$app->pipe(\Dot\ResponseHeader\Middleware\ResponseHeaderMiddleware::class);
```

## Add configuration in autoload

Create a new file `response-header.global.php` in `config/autoload` with the below configuration array :

```php
<?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
]
],
]
];
```
10 changes: 5 additions & 5 deletions docs/book/v3/installation.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Installation

Install dotkernel/dot-response-header by executing the following Composer command in your project directory:

composer require dotkernel/dot-response-header
# Installation

Install dotkernel/dot-response-header by executing the following Composer command in your project directory:

composer require dotkernel/dot-response-header
6 changes: 3 additions & 3 deletions docs/book/v3/overview.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Overview

`dot-response-header` is DotKernel's middleware for setting and overwriting custom response headers.
# Overview

`dot-response-header` is DotKernel's middleware for setting and overwriting custom response headers.
48 changes: 24 additions & 24 deletions docs/book/v3/usage.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# Usage

Because headers are matched with route names, we can have custom response headers for every request, by defining new headers under the `*` key, in the configuration file `response-header.global.php`.

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

```php
'dot_response_headers' => [
'user' => [
'UserCustomHeader' => [
'value' => 'UserCustomHeader-Value',
'overwrite' => false
]
],
]

// This will set a new header named UserCustomHeader with the UserCustomHeader-Value value for any route name matching 'user'
```

To overwrite an existing header use `overwrite => true`.
# Usage

Because headers are matched with route names, we can have custom response headers for every request, by defining new headers under the `*` key, in the configuration file `response-header.global.php`.

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

```php
'dot_response_headers' => [
'user' => [
'UserCustomHeader' => [
'value' => 'UserCustomHeader-Value',
'overwrite' => false
]
],
]

// This will set a new header named UserCustomHeader with the UserCustomHeader-Value value for any route name matching 'user'
```

To overwrite an existing header use `overwrite => true`.

0 comments on commit adfd94e

Please sign in to comment.