mi rule
'last_name' => 'required|alpha|max:100',
i can't put a normal last_name. eg. Smith Stan.
only Smith because intro stan and smith have a 'space' That can be changed?
try using regex rule;
'last_name' => [ 'Required',
'Regex:/^[\D]+$/i',
'max:100'
]
allows any number of non-numeric characters
I put it in my files in the request folder? Or put them directly in the controller? Are you sure you have to wear that character ']' ? I remove the 'alpha'?
above is the replacement rule.
because regex patterns can use a pipe | it is important to learn that you can provide a rule as an array.
If you do not want to do it this way, replace
'last_name' => 'required|alpha|max:100',
with this
'last_name' => 'required|Regex:/^[\D]+$/i|max:100',
thanks @Snapey ! is works! you are a master
Please sign in or create an account to participate in this conversation.