From 87542e3d9f77b52e5d8e11ee4a8228e823337b16 Mon Sep 17 00:00:00 2001 From: Kyle Date: Fri, 15 Mar 2024 10:57:32 +0100 Subject: [PATCH] Update DateTimeInterfaceCast.php Cast `$value` to `string` explictly because `DateTime::createFromFormat()` expects `string` since PHP 8 --- src/Casts/DateTimeInterfaceCast.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Casts/DateTimeInterfaceCast.php b/src/Casts/DateTimeInterfaceCast.php index b86dc4ee..5231e027 100644 --- a/src/Casts/DateTimeInterfaceCast.php +++ b/src/Casts/DateTimeInterfaceCast.php @@ -42,7 +42,7 @@ protected function castValue( $datetime = $formats ->map(fn (string $format) => rescue(fn () => $type::createFromFormat( $format, - $value, + (string) $value, isset($this->timeZone) ? new DateTimeZone($this->timeZone) : null ), report: false)) ->first(fn ($value) => (bool) $value);