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.
Copy file name to clipboardExpand all lines: README.md
+2-10Lines changed: 2 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -36,17 +36,9 @@ $this->propertiesFrom($model);
36
36
$this->propertiesFrom($array);
37
37
```
38
38
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:
39
+
If you want to use dynamic properties, adjust the `dynamic_properties` key in the config and add the following trait if your class is not already implementing the magic methods:
40
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
-
}
41
+
use WithDynamicProperties;
50
42
```
51
43
52
44
`Note: if you use the Livewire components, it already has similar definitions under the hood.`
0 commit comments