Skip to content

Commit 82e7294

Browse files
Allow CarbonImmutable as date instance
1 parent 8d34a93 commit 82e7294

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/DatetimeParser.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Illuminate\Database\Eloquent\Concerns\HasAttributes;
66
use Illuminate\Support\Carbon;
7+
use Carbon\CarbonImmutable;
78

89
class DatetimeParser
910
{
@@ -19,9 +20,9 @@ class DatetimeParser
1920
*
2021
* @param mixed $value
2122
* @param null|string $format
22-
* @return Carbon
23+
* @return Carbon|CarbonImmutable
2324
*/
24-
public function parse(mixed $value, ?string $format): Carbon
25+
public function parse(mixed $value, ?string $format): Carbon|CarbonImmutable
2526
{
2627
$this->format = $format;
2728

@@ -38,4 +39,4 @@ public function getDateFormat()
3839
{
3940
return $this->format;
4041
}
41-
}
42+
}

0 commit comments

Comments
 (0)