Tuesday 15 September 2015

validation - How to validate select box input in Laravel4 -


Currently, when I want to validate a selected box, I must include all the values ​​within the verification value. Public stable $ rule = array ('type' = & gt; array ('required', 'in: a, b, c, d'));

Is this the best practice way to use an array?

For example: I have a long list of country names and want to include it in the form of legalization. The way to do this will be with the following:

  public static $ rules = array ('type' = & gt; array ('required', 'in:'. Implode ',' $ Countries)));   

Thanks

A custom is possible, but a present- Rule can also be employed More details on

No comments:

Post a Comment