FullName doesn’t work with multi-word surnames
RicLeP opened this issue · comments
Ric Le Poidevin commented
My surname is ‘Le Poidevin’ but this gets changed to just ‘Poidevin’.
$name = new FullName('Richard Le Poidevin');
dd($name->toArray());
//
array:3 [
"fullName" => "Richard Le Poidevin"
"firstName" => "Richard"
"lastName" => "Poidevin" // should be: Le Poidevin
]
It’s a tricky one, where should you break, always the first space? Some people may have multiple first names but I think that’s more likely to be hyphenated whilst surnames with ‘Le’ etc. are pretty common. It’s still better than what usually happens to my name - ‘Richard L’ 😅
Maybe the default behaviour should be firstName
is the first word and everything else forms lastName
?
Michael Rubél commented
Likely fixed in #17 🙂