# DefaultValue

> Applies a runtime default when assigned input is null or an empty string.

[API reference](/docs/api/index.md) › [Model](/docs/extensions/model/reference/index.md) › [Attribute](/docs/extensions/model/reference/attribute/index.md) › DefaultValue

| final readonly class | `UIAwesome\Model\Attribute\DefaultValue` |
| --- | --- |
| Source | [`src/Attribute/DefaultValue.php`](https://github.com/ui-awesome/model/blob/main/src/Attribute/DefaultValue.php#L12) |

Applies a runtime default when assigned input is `null` or an empty string.

## Properties

| Property | Type | Description | Defined by |
| --- | --- | --- | --- |
| <span id="property-value"></span>`$value` readonly constructor | `mixed` | Runtime default value. | `DefaultValue` |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`__construct()`](#method-__construct) | Configures the value applied to `null` or empty-string input. | `DefaultValue` |

## Method details

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

```php
public function __construct(mixed $value)
```

Configures the value applied to `null` or empty-string input.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `mixed` | Runtime default value. |