validator number laravel 1

validator number laravel

$rules = ['Fno' => 'numeric|min:2|max:5', 'Lno' => 'numeric|min:2'];

Here is what the above code is Doing:
1. We are creating a new instance of the Validator class.
2. We are passing the data to be validated as the first argument.
3. We are passing the rules as the second argument.
4. We are calling the passes() method to check if the validation passes.
5. If the validation passes, we are returning the data.
6. If the validation fails, we are returning the errors.

Similar Posts