We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 21d2448 commit fc89ca3Copy full SHA for fc89ca3
1 file changed
src/PrefillGravityForms/Models/UserModel.php
@@ -62,6 +62,11 @@ public function age(): int
62
return (int) ($this->data['leeftijd'] ?? 0);
63
}
64
65
+ public function initials(): string
66
+ {
67
+ return (string) ($this->data['naam']['voorletters'] ?? '');
68
+ }
69
+
70
public function firstNames(): string
71
{
72
return (string) ($this->data['naam']['voornamen'] ?? '');
@@ -76,4 +81,15 @@ public function lastNamePrefix(): string
76
81
77
82
return (string) ($this->data['naam']['voorvoegsel'] ?? '');
78
83
84
85
+ public function fullName(bool $withInitials = false): string
86
87
+ $nameParts = [
88
+ $withInitials ? $this->initials() : $this->firstNames(),
89
+ $this->lastNamePrefix(),
90
+ $this->lastName(),
91
+ ];
92
93
+ return implode(' ', array_filter($nameParts));
94
79
95
0 commit comments