From 2503f614ee22e2eb24f50dab0e3e180effe74069 Mon Sep 17 00:00:00 2001 From: gabrielpetrescu Date: Tue, 11 Mar 2025 17:32:19 +0200 Subject: [PATCH] feat: Fix americanDate function deprecated for php 8.4 --- src/helpers.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; }