'; } } if (!function_exists('dd')) { function dd(...$vars): void { foreach ($vars as $var) { var_dump($var); } die(); } } if (!function_exists('formatPrice')) { function formatPrice($price): string { return 'CHF ' . number_format($price, 2, '.', '\''); } } if (!function_exists('formatDate')) { function formatDate($date): string { return date('d.m.Y', strtotime($date)); } } if (!function_exists('generateSlug')) { function generateSlug(string $text): string { $text = mb_strtolower($text, 'UTF-8'); $text = preg_replace('/[^a-z0-9\s-]/', '', $text); $text = preg_replace('/[\s-]+/', '-', $text); return trim($text, '-'); } }