Skip to content

Commit 1b356de

Browse files
Update DateTimeInterfaceCast.php
1 parent 675f892 commit 1b356de

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/SettingsCasts/DateTimeInterfaceCast.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use DateTimeImmutable;
99
use DateTimeInterface;
1010
use Exception;
11+
use Illuminate\Support\Carbon as IlluminateCarbon;
1112

1213
class DateTimeInterfaceCast implements SettingsCast
1314
{
@@ -32,6 +33,10 @@ public function get($payload): ?DateTimeInterface
3233
return new CarbonImmutable($payload);
3334
}
3435

36+
if ($this->type === IlluminateCarbon::class) {
37+
return new IlluminateCarbon($payload);
38+
}
39+
3540
if ($this->type === DateTimeImmutable::class) {
3641
return new DateTimeImmutable($payload);
3742
}

0 commit comments

Comments
 (0)