I've trying out the new boolean validation rule in 4.2.3: http://laravel.com/docs/validation#rule-boolean
// Validation rules public static $rules = array( 'administrator' => 'sometimes|required|boolean', 'payer' => 'sometimes|required|boolean', );
When my validation fails; the default error message returned is simply "validation.boolean".
I've tried creating a custom error message on my model but it doesn't seem to have any effect.
// Custom validation error messages public static $messages = array( 'boolean' => 'The :attribute must be a valid boolean value.', );
Any thoughts?
OK; when I actually add my custom error messages to the Validator::make() call it works:
$validation = Validator::make( $member_properties, Member::$rules, Member::$messages );
So I'll go that route.
I also had this problem, fixed it by updating lang/en/validation.php with:
"boolean" => "The :attribute field must be a valid boolean value.",
You should create a new pull request for the validation rule.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community