Skip to content

Commit

Permalink
Translate Enum rule message (#40089)
Browse files Browse the repository at this point in the history
  • Loading branch information
driesvints authored Dec 17, 2021
1 parent a049279 commit 00eeab6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Illuminate/Validation/Rules/Enum.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ public function passes($attribute, $value)
*/
public function message()
{
return [
'The selected :attribute is invalid.',
];
$message = trans('validation.enum');

return $message === 'validation.enum'
? ['The selected :attribute is invalid.']
: $message;
}
}

0 comments on commit 00eeab6

Please sign in to comment.