@gpluess is give the correct answer but you can use 'alpha_num' like:
public function rules()
{
return [
'name' =>'required',
'username'=>'required|alpha_num',
];
}
Hope this work for you!
This validation code is use in your validation script
public function rules()
{
return [
'name' =>'required',
'username'=>'required|regex:/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).+$/,
];
}
Hope this work for you.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community