jqh 5 年之前
父节点
当前提交
712eafb53f
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      src/Form/Field/Text.php

+ 5 - 1
src/Form/Field/Text.php

@@ -69,7 +69,11 @@ class Text extends Field
 
         $attributes = [
             'data-match'       => '#'.$field->getElementId(),
-            'data-match-error' => str_replace([':attribute', ':other'], [$this->label, $name], $error ?: trans('admin.validation.match')),
+            'data-match-error' => str_replace(
+                [':attribute', ':other'],
+                [$field->label(), $this->label()],
+                $error ?: trans('admin.validation.match')
+            ),
         ];
 
         return $this->attribute($attributes);