Skip to content

Commit 5a8132b

Browse files
Allow truth-y false-y values
1 parent b05307d commit 5a8132b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/BooleanDateAttribute.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ private static function setBooleanDate(mixed $value, array $attributes, string $
2121
{
2222
// Only update the field if it's never been set before or when it's being "disabled"
2323

24-
if ($value === false || ! array_key_exists($column, $attributes) || $attributes[$column] === null) {
25-
return [$column => $value === false ? null : CarbonImmutable::now()];
24+
if (! $value || ! array_key_exists($column, $attributes) || $attributes[$column] === null) {
25+
return [$column => ! $value ? null : CarbonImmutable::now()];
2626
}
2727

2828
return [];

0 commit comments

Comments
 (0)