Enable NULLs in LeenooksCarbon cast

This commit is contained in:
Deon George 2024-07-31 22:40:35 +10:00
parent eaece2b69d
commit 8acc3a91af

View File

@ -13,9 +13,9 @@ class LeenooksCarbon implements CastsAttributes
*
* @param array<string, mixed> $attributes
*/
public function get(Model $model, string $key, mixed $value, array $attributes): Carbon
public function get(Model $model, string $key, mixed $value, array $attributes): ?Carbon
{
return Carbon::create($value);
return $value ? Carbon::create($value) : NULL;
}
/**