# HasPing

> Provides an immutable API for the ping attribute.

[API reference](/docs/api/index.md) › [HTML Attribute](/docs/extensions/html-attribute/reference/index.md) › HasPing

| trait | `UIAwesome\Html\Attribute\HasPing` |
| --- | --- |
| Source | [`src/HasPing.php`](https://github.com/ui-awesome/html-attribute/blob/main/src/HasPing.php#L18) |

Used by 1 type:

- [`UIAwesome\Html\Palpable\A`](/docs/extensions/html/reference/palpable/a/index.md)

Provides an immutable API for the `ping` attribute.

See also: <https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/a#ping>.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`ping()`](#method-ping) | Sets the `ping` attribute. | `HasPing` |

## Method details

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

```php
public function ping(string|Stringable|UnitEnum|null $value): static
```

Sets the `ping` attribute.

Defines the space-separated URL list for ping tracking.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `string\|`[`Stringable`](https://www.php.net/manual/en/class.stringable.php)`\|`[`UnitEnum`](https://www.php.net/manual/en/class.unitenum.php)`\|null` | Ping URL list, or `null` to remove the attribute. |

**Returns**

`static`: New instance with the updated `ping` attribute.