Selaa lähdekoodia

wesmiler 报恩寺项目

wesmiler 4 vuotta sitten
vanhempi
commit
eb37740e5d
1 muutettua tiedostoa jossa 13 lisäystä ja 0 poistoa
  1. 13 0
      app/Helpers/common.php

+ 13 - 0
app/Helpers/common.php

@@ -1197,6 +1197,19 @@ if (!function_exists('message')) {
     }
     }
 }
 }
 
 
+if (!function_exists('getValidatorError')) {
+    /**
+     * 错误验证
+     * @param $error
+     * @return mixed
+     */
+    function getValidatorError($validator)
+    {
+        $errors = $validator->errors()->all();
+        return isset($errors[0]) ? $errors[0] : 'validator error';
+    }
+}
+
 if (!function_exists('lang')) {
 if (!function_exists('lang')) {
     /**
     /**
      * 语言转换
      * 语言转换