Laravel全名检查它是否实际已满[关闭]

How can I check in Laravel default registration form if user actually input full name in the name field, instead of just first name? I don't want to modify form just for that, to have first and last name. Also, I'm asking if there is some check option built in, but if not I can use pure PHP check..

No there is not such an option built into Laravel.

You would have to write your own function.

But the first question to ask is how to determine whether a name is a full name or not? You can assume that a full name is two strings with a space in between. However people have a first name which might consist of two parts, or a last name in two parts. Chinese names start with the last name and end with the first name.

Generally when creating registration form you divide the name in 2 inputs, first and last. This is also much better when persisting to the database.

Imagine for example if you want to retrieve users by last name and sort them alphabetically. If you store the full name instead of first and last name separately this will be a headache.