mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix lnms some commands throwing errors (#13265)
ones that don't have custom validation messages
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user