jqh 5 years ago
parent
commit
91ad357641
1 changed files with 15 additions and 2 deletions
  1. 15 2
      src/Form.php

+ 15 - 2
src/Form.php

@@ -907,11 +907,24 @@ class Form implements Renderable
     {
         $relations = [];
         $this->builder->fields()->each(function ($field) use (&$relations) {
-            if (Str::contains($field->column(), '.')) {
-                $first = explode('.', $field->column())[0];
+            $column = $field->column();
+
+            if (is_array($column)) {
+                foreach ($column as $v) {
+                    if (Str::contains($v, '.')) {
+                        $first = explode('.', $v)[0];
+                        $relations[$first] = null;
+                    }
+                }
+
+                return;
+            }
 
+            if (Str::contains($column, '.')) {
+                $first = explode('.', $column)[0];
                 $relations[$first] = null;
             }
+
         });
 
         foreach ($relations as $first => $v) {