Skip to content

Commit 38ffe8b

Browse files
authored
Merge pull request #43 from gearbox-solutions/fix-deprecated-parameter
Passing null to str_starts_with is deprecated
2 parents 6332eb2 + 5fa9d73 commit 38ffe8b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Database/Eloquent/Concerns/FMHasAttributes.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function setAttribute($key, $value)
3535
}
3636
// When writing dates the regular datetime format won't work, so we have to get JUST the date value
3737
// check the key's cast to see if it is cast to a date or custom date:format
38-
$castType = $this->getCasts()[$key] ?? null;
38+
$castType = $this->getCasts()[$key] ?? '';
3939
$isDate = $castType == "date" || str_starts_with($castType, 'date:');
4040
if ($isDate) {
4141
$value = Arr::first(explode(' ', $value));
@@ -56,4 +56,4 @@ public function setAttribute($key, $value)
5656
return $this;
5757
}
5858

59-
}
59+
}

0 commit comments

Comments
 (0)