瀏覽代碼

fix findFieldByName

jqh 5 年之前
父節點
當前提交
24b6ee95ba
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/Form/Concerns/HasFiles.php

+ 4 - 0
src/Form/Concerns/HasFiles.php

@@ -53,6 +53,10 @@ trait HasFiles
      */
     public function findFieldByName(?string $column)
     {
+        if ($field = $this->builder->field($column)) {
+            return $field;
+        }
+        
         if (mb_strpos($column, '.')) {
             [$relation, $column] = explode('.', $column);