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
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,9 +45,9 @@ class CompanyProfile extends Component
45
45
*
46
46
* @var string|null
47
47
*/
48
-
public ?string $name;
49
-
public ?string $tax_number;
50
-
public ?string $address;
48
+
public ?string $name = null;
49
+
public ?string $tax_number = null;
50
+
public ?string $address = null;
51
51
52
52
/**
53
53
* @return void
@@ -59,6 +59,10 @@ class CompanyProfile extends Component
59
59
}
60
60
```
61
61
62
+
## Why?
63
+
Why should I use it like this instead of just passing the model to the view?
64
+
Because the models are huge objects and you probably shouldn't expose them to the frontend for security and performance reasons. Another thing is primitive view variables are highly customizable through view composers, while it's harder to decorate in the case of using models.
0 commit comments