So, I have the following rules in my model:
public static $rules = array(
'name' => 'required|alpha_dash|unique:subsidiaries',
'internal_number' => 'required|alpha_dash|unique:subsidiaries',
'expedition_rate' => array('required', 'regex:/^[0-9]{1,3}(\.?)[0-9]{1,2}$/'),
'hundred_kg_rate' => array('regex:/^[0-9]{1,5}(\.?)[0-9]{1,2}$/'),
'handling' => array('regex:/^[0-9]{1,3}(\.?)[0-9]{1,2}$/'),
'insurance' => 'required|numeric',
);
But, for some reason, when the regex is applied in the pattern attribute tag in html... it breaks!
Result:
<input required="true" pattern="^[0-9]{" class="form-control" ....>
_________
\
=> This right here should be
^[0-9]{1,3}(\.?)[0-9]{1,2}$
Former, by any chance?Former... the rules are passed on from the controller to the view