Upgrade to 3.4.1
This commit is contained in:
@@ -284,8 +284,9 @@ class Field extends Component
|
||||
|
||||
unset($array['model']);
|
||||
|
||||
$array['invalid'] = $this->isInvalid();
|
||||
$array['errors'] = $this->errors();
|
||||
$array['invalid'] = $this->isInvalid();
|
||||
$array['saveable'] = $this->save();
|
||||
$array['signature'] = md5(json_encode($array));
|
||||
|
||||
ksort($array);
|
||||
|
@@ -85,13 +85,22 @@ class Form
|
||||
}
|
||||
}
|
||||
|
||||
public function data($defaults = false): array
|
||||
public function content(): array
|
||||
{
|
||||
return $this->data(false, false);
|
||||
}
|
||||
|
||||
public function data($defaults = false, bool $includeNulls = true): array
|
||||
{
|
||||
$data = $this->values;
|
||||
|
||||
foreach ($this->fields as $field) {
|
||||
if ($field->save() === false || $field->unset() === true) {
|
||||
$data[$field->name()] = null;
|
||||
if ($includeNulls === true) {
|
||||
$data[$field->name()] = null;
|
||||
} else {
|
||||
unset($data[$field->name()]);
|
||||
}
|
||||
} else {
|
||||
$data[$field->name()] = $field->data($defaults);
|
||||
}
|
||||
|
Reference in New Issue
Block a user