Skip to content

Commit

Permalink
Fixed validator not failing when custom message is null
Browse files Browse the repository at this point in the history
  • Loading branch information
stevebauman authored Jul 15, 2019
1 parent 4b0cdaf commit 84c796a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Validation/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ protected function validateUsingCustomRule($attribute, $value, $rule)
if (! $rule->passes($attribute, $value)) {
$this->failedRules[$attribute][get_class($rule)] = [];

$messages = (array) $rule->message();
$messages = $rule->message() ? (array) $rule->message() : [get_class($rule)];

foreach ($messages as $message) {
$this->messages->add($attribute, $this->makeReplacements(
Expand Down

0 comments on commit 84c796a

Please sign in to comment.