Laravel Validation - number must start with 0 (zero)
问题 How to do input validation that a number must start with 0? For example: $rules = [ 'full_name' => 'required|min:6', 'number' => 'required|numeric|min:5', ]; On the number field, it is requred, must be numberic only and minimum of 5 digits. I also need to include rule that it must start with 0? 回答1: Use laravel regex:pattern validator, inside an array (Issue with Laravel Rules & Regex (OR) operator) and a regex of something like this: /^[0][0-9]{4,}/ 回答2: You can try it with substr(Input::get