FakerPHP / Faker

Faker is a PHP library that generates fake data for you
https://fakerphp.github.io
Other
3.49k stars 331 forks source link

Not possible to generate a unique name where you can separate first and last name #673

Closed deviationist closed 10 months ago

deviationist commented 11 months ago

Hello!

When using faker I can do like this $faker->unique()->name(), but if if I need both first and last name this does not float since I just get a string. I could possible split the string up into parts by whitespace and guess which one is first and last name.

Suggestion: $faker->unique()->firstAndLastName() or $faker->unique()->nameParts(). This would then return a fully unique name, but as an object where you can access the first and last name.

DvDty commented 11 months ago

Can't you use $faker->firstNameMale / $faker->firstNameFemale and $faker->lastName with combination with unique?

pimjansen commented 11 months ago

Indeed there are separate methods already available so i do not see any usecase for this

localheinz commented 10 months ago

@deviationist

Sounds like a feature request to me, not a bug report. We may consider adding such a feature in the future.