Skip to content

Commit

Permalink
Merge pull request #707 from kylekatarnls/patch-1
Browse files Browse the repository at this point in the history
Cast value to string for createFromFormat
  • Loading branch information
rubenvanassche authored Apr 4, 2024
2 parents a5df67e + 87542e3 commit f01f389
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Casts/DateTimeInterfaceCast.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f01f389

Please sign in to comment.