Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

In my Laravel 4 app, I have a form on which I need to validate numbers with comma as decimal separator. For the moment, it only work with point because my validation rule is :

public static $rules = array(
    'amount' => 'numeric|min:0',
);

What‘s the best method :

  • Keep the rule and replace comma with point before validation ? Is there a before_validation observer or something like this ?
  • Build a custom validation rule ? french_numeric for example ?
share

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.