Support the ongoing development of Laravel.io →
Requests Input Validation
Last updated 2 years ago.
0

@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!

0

@saurabhd @gpluess thanks for replying, i mean have at least one character and one numeric

0

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.

Last updated 7 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.