Support the ongoing development of Laravel.io →
Requests Input Validation
Last updated 10 months 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 5 years ago.
0

Sign in to participate in this thread!

Full Stack Europe

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.

© 2023 Laravel.io - All rights reserved.