MapFrom
API reference › Model › Attribute › MapFrom
Maps a model property from an explicit input key.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$key readonly | string | Identifies the external input key mapped to this property. | MapFrom |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Configures the external input key. | MapFrom |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(string $key)Configures the external input key.
Parameters
| Parameter | Type | Description |
|---|---|---|
$key | string | Nonempty input key. |
Throws
InvalidArgumentException: When the key is empty.