# SidebarSnapshot

> Typed view-model for the snapshot card surfaced at the top of the debugger sidebar ('CURRENT REQUEST' / 'NEWEST REQUEST').

[API reference](/docs/api/index.md) › [Debug Core](/docs/extensions/debug-core/reference/index.md) › [View](/docs/extensions/debug-core/reference/view/index.md) › [Sidebar](/docs/extensions/debug-core/reference/view/sidebar/index.md) › SidebarSnapshot

| final readonly class | `PHPForge\Debug\View\Sidebar\SidebarSnapshot` |
| --- | --- |
| Source | [`src/View/Sidebar/SidebarSnapshot.php`](https://github.com/php-forge/debug-core/blob/main/src/View/Sidebar/SidebarSnapshot.php#L19) |

Typed view-model for the snapshot card surfaced at the top of the debugger sidebar ('CURRENT REQUEST' /
'NEWEST REQUEST').

The request identity is derived from the capture summary, so every host renders the method, URL, status, and time
of a capture the same way; the navigator row comes from the host through [`SidebarNavigation`](/docs/extensions/debug-core/reference/view/sidebar/sidebarnavigation/index.md).

## Properties

| Property | Type | Description | Defined by |
| --- | --- | --- | --- |
| <span id="property-ariaLabel"></span>`$ariaLabel` readonly constructor | `string` | Accessible name for the surrounding `<section>` element. | `SidebarSnapshot` |
| <span id="property-fullUrl"></span>`$fullUrl` readonly constructor | `string` | Full URL captured in the request summary; used as the `title` hover on the URL chip. | `SidebarSnapshot` |
| <span id="property-isAjax"></span>`$isAjax` readonly constructor | `bool` | Whether the captured request was an AJAX request; surfaces the 'AJAX' tag in the card meta strip. | `SidebarSnapshot` |
| <span id="property-method"></span>`$method` readonly constructor | `string` | HTTP method ('GET', 'POST', ...). Empty when not captured. | `SidebarSnapshot` |
| <span id="property-navigation"></span>`$navigation` readonly constructor | [`SidebarNavigation`](/docs/extensions/debug-core/reference/view/sidebar/sidebarnavigation/index.md) | Navigator row moving away from this capture. | `SidebarSnapshot` |
| <span id="property-path"></span>`$path` readonly constructor | `string` | Path-only URL display (scheme/host stripped). Empty when not captured. | `SidebarSnapshot` |
| <span id="property-statusCode"></span>`$statusCode` readonly constructor | `int` | Response status code; '0' when not captured. | `SidebarSnapshot` |
| <span id="property-statusVariant"></span>`$statusVariant` readonly constructor | `string` | Status-pill CSS modifier ('2xx' / '3xx' / '4xx' / '5xx' / 'none') derived from `$statusCode`. | `SidebarSnapshot` |
| <span id="property-time"></span>`$time` readonly constructor | `string` | Formatted request time ('HH:MM:SS'); empty when not captured. | `SidebarSnapshot` |
| <span id="property-title"></span>`$title` readonly constructor | `string` | Section heading shown above the snapshot card ('Current request' / 'Newest request'). | `SidebarSnapshot` |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`fromSummary()`](#method-fromSummary) static | Creates the snapshot card of one capture. | `SidebarSnapshot` |

## Method details

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

```php
public static function fromSummary(PHPForge\Debug\Storage\RequestSummary $summary, PHPForge\Debug\View\Sidebar\SidebarNavigation $navigation, string $title, string|null $ariaLabel = null): self
```

Creates the snapshot card of one capture.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$summary` | [`PHPForge\Debug\Storage\RequestSummary`](/docs/extensions/debug-core/reference/storage/requestsummary/index.md) | Summary of the capture the card describes. |
| `$navigation` | [`SidebarNavigation`](/docs/extensions/debug-core/reference/view/sidebar/sidebarnavigation/index.md) | Navigator row the host computed for that capture. |
| `$title` | `string` | Section heading shown above the card. |
| `$ariaLabel` | `string\|null` | Accessible name of the section, or `null` to reuse the heading. |

**Returns**

`self`: Snapshot card view-model.