Skip to content

Commit c6bdb47

Browse files
committed
don't parse if the date is null
1 parent 6f71ad0 commit c6bdb47

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Database/Eloquent/Concerns/FMHasAttributes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function setAttribute($key, $value)
3535
// check the key's cast to see if it is cast to a date or custom date:format
3636
$castType = $this->getCasts()[$key] ?? '';
3737
$isDate = $castType == 'date' || str_starts_with($castType, 'date:');
38-
if ($isDate) {
38+
if ($isDate && ($value !== null)) {
3939
$value = Arr::first(explode(' ', $value));
4040
}
4141

0 commit comments

Comments
 (0)