Skip to content

Commit de0e7c4

Browse files
authored
Merge pull request #166 from patricktorres27/add-null-default
Add nullDefault() method
2 parents abc6162 + ecf0f13 commit de0e7c4

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/Html/Editor/Fields/Field.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,4 +360,18 @@ public function getType(): string
360360
{
361361
return $this->type;
362362
}
363+
364+
/**
365+
* Replace null values with the field's default on edit.
366+
*
367+
* @param bool $value
368+
* @return $this
369+
* @see https://editor.datatables.net/reference/option/fields.nullDefault
370+
*/
371+
public function nullDefault(bool $value = true): static
372+
{
373+
$this->attributes['nullDefault'] = $value;
374+
375+
return $this;
376+
}
363377
}

0 commit comments

Comments
 (0)