diff --git a/src/helpers.php b/src/helpers.php index 62dfe14..54371a6 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -67,7 +67,7 @@ function telescopeException(Throwable $exception, $message = null): void } if (! function_exists('americanDate')) { - function americanDate(CarbonInterface $date = null, string $format = 'm/d/Y', $default = null): string|Closure|null + function americanDate(?CarbonInterface $date = null, string $format = 'm/d/Y', $default = null): string|Closure|null { try { if (is_null($date)) { @@ -75,7 +75,7 @@ function americanDate(CarbonInterface $date = null, string $format = 'm/d/Y', $d return $default; } - return function (CarbonInterface $value = null) use ($format, $default) { + return function (?CarbonInterface $value = null) use ($format, $default) { if (is_null($value)) { return $default; }