Przeglądaj źródła

移除表单提交自动过滤disable、readonly字段功能

jqh 4 lat temu
rodzic
commit
c0866dcdf1
1 zmienionych plików z 12 dodań i 10 usunięć
  1. 12 10
      src/Form.php

+ 12 - 10
src/Form.php

@@ -689,16 +689,6 @@ class Form implements Renderable
     {
         Arr::forget($input, $this->ignored);
 
-        $ignored = $this->fields()->map(function (Field $field) {
-            if ($field instanceof Field\Display || $field->getAttribute('readonly') || $field->getAttribute('disabled')) {
-                return $field->column();
-            }
-        })->filter();
-
-        if (! $ignored->isEmpty()) {
-            Arr::forget($input, $ignored->flatten()->toArray());
-        }
-
         return $input;
     }
 
@@ -1011,6 +1001,18 @@ class Form implements Renderable
         return $this;
     }
 
+    /**
+     * @param $keys
+     *
+     * @return $this
+     */
+    public function forgetIgnored($keys)
+    {
+        Arr::forget($this->ignored, $keys);
+
+        return $this;
+    }
+
     /**
      * Get primary key name of model.
      *