# HistoryAction

> Serves the captured request history grid.

[API reference](/docs/api/index.md) › [Yii3 Debug](/docs/extensions/yii3-debug/reference/index.md) › [Action](/docs/extensions/yii3-debug/reference/action/index.md) › HistoryAction

| final readonly class | `Yii3\Debug\Action\HistoryAction` |
| --- | --- |
| Implements | [`DebugActionInterface`](/docs/extensions/yii3-debug/reference/action/debugactioninterface/index.md) |
| Source | [`src/Action/HistoryAction.php`](https://github.com/yii3/debug/blob/main/src/Action/HistoryAction.php#L17) |

Serves the captured request history grid.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`__construct()`](#method-__construct) | Creates the request-history endpoint for snapshots retained by the store. | `HistoryAction` |
| [`__invoke()`](#method-__invoke) | Renders the captured request history, filtered and paginated by the query parameters. | `HistoryAction` |

## Method details

### __construct() <span id="method-__construct"></span>

```php
public function __construct(PHPForge\Debug\Storage\SnapshotStore $store, Yii3\Debug\Web\DebugPageRenderer $renderer, Psr\Http\Message\ResponseFactoryInterface $responseFactory, Psr\Http\Message\StreamFactoryInterface $streamFactory)
```

Creates the request-history endpoint for snapshots retained by the store.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$store` | `PHPForge\Debug\Storage\SnapshotStore` | Store the captured snapshots are read from. |
| `$renderer` | [`Yii3\Debug\Web\DebugPageRenderer`](/docs/extensions/yii3-debug/reference/web/debugpagerenderer/index.md) | Renderer producing the debugger page markup. |
| `$responseFactory` | `Psr\Http\Message\ResponseFactoryInterface` | Factory building the PSR-7 response. |
| `$streamFactory` | `Psr\Http\Message\StreamFactoryInterface` | Factory building the PSR-7 response body. |

### __invoke() <span id="method-__invoke"></span>

```php
public function __invoke(Psr\Http\Message\ServerRequestInterface $request): Psr\Http\Message\ResponseInterface
```

Renders the captured request history, filtered and paginated by the query parameters.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$request` | `Psr\Http\Message\ServerRequestInterface` | Incoming request carrying the query parameters. |

**Returns**

`Psr\Http\Message\ResponseInterface`: Rendered history page.