You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 12, 2024. It is now read-only.
Assign Eloquent model attributes to class properties:
29
+
#### Assign Eloquent model attributes to class properties:
30
30
```php
31
31
$this->propertiesFrom($model);
32
32
```
33
33
34
-
Assign array key values to class properties:
34
+
#### Assign array key values to class properties:
35
35
```php
36
36
$this->propertiesFrom($array);
37
37
```
38
38
39
-
Dump class properties:
39
+
If you want to use dynamic properties, adjust the `dynamic_properties` key in the config and add the following methods if your class is not already implementing it:
40
+
```php
41
+
public function __get(string $name): mixed
42
+
{
43
+
return $this->{$name};
44
+
}
45
+
46
+
public function __set(string $name, $value): void
47
+
{
48
+
$this->{$name} = $value;
49
+
}
50
+
```
51
+
52
+
`Note: if you use the Livewire components, it already has similar definitions under the hood.`
0 commit comments