Fix lnms some commands throwing errors (#13265)

ones that don't have custom validation messages
This commit is contained in:
Tony Murray
2021-09-23 08:29:45 -05:00
committed by GitHub
parent ba84acc1db
commit c579de7ea7

View File

@ -107,10 +107,11 @@ abstract class LnmsCommand extends Command
*/
protected function validate(array $rules, array $messages = []): array
{
$error_messages = trans('commands.' . $this->getName() . '.validation-errors');
$validator = Validator::make(
$this->arguments() + $this->options(),
$rules,
array_merge(trans('commands.' . $this->getName() . '.validation-errors'), $messages)
is_array($error_messages) ? array_merge($error_messages, $messages) : $messages
);
try {