# CastValueInterface

> Contract for custom value casters used by #[Cast].

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

| interface | `UIAwesome\Model\CastValueInterface` |
| --- | --- |
| Source | [`src/CastValueInterface.php`](https://github.com/ui-awesome/model/blob/main/src/CastValueInterface.php#L10) |

Contract for custom value casters used by `#[Cast]`.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`cast()`](#method-cast) abstract | Casts the incoming value into a target representation. | `CastValueInterface` |

## Method details

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

```php
abstract public function cast(mixed $value): mixed
```

Casts the incoming value into a target representation.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `mixed` |  |

**Returns**

`mixed`