translatedFormat($format); } } if (! function_exists('formatDateTime')) { function formatDateTime(string $dateTime): string { return Carbon::parse($dateTime)->translatedFormat('l, d M Y H:i:s'); } } if (! function_exists('formatDateDash')) { function formatDateDash(string $date): string { return Carbon::parse($date)->translatedFormat('Y-m-d'); } } if (! function_exists('timeAgo')) { function timeAgo(?string $date = null): string { return ! $date ? '-' : Carbon::parse($date)->diffForHumans(); } }