in laravel docs there seems to be an integer and a numeric validation rule. i was wondering what the difference between the both was?
Each form request generated by Laravel has two methods: authorize and rules .
The validate method accepts an incoming HTTP request and a set of validation rules. If the validation rules pass, your code will keep executing normally; however, if validation fails, an exception will be thrown and the proper error response will automatically be sent back to the user.
Usage. Validate a 2 character country code. use LVR\CountryCode\Two; $request->validate([ 'country' => ['required', new Two], ]);
confirmed. The field under validation must have a matching field of foo_confirmation . For example, if the field under validation is password , a matching password_confirmation field must be present in the input.
Integer is like a whole number without fraction: 2, 256, 2048
.
http://php.net/manual/en/function.is-int.php
Numeric is any number including floating point numbers: 2.478, +0123.45e6
http://php.net/manual/en/function.is-numeric.php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With