@php function slugify($urlString) { $search = ['Ș', 'Ț', 'ş', 'ţ', 'Ş', 'Ţ', 'ș', '', 'î', 'â', 'ă', 'Î', ' ', 'Ă', 'ë', 'Ë']; $replace = ['s', 't', 's', 't', 's', 't', 's', 't', 'i', 'a', 'a', 'i', '-', 'a', 'e', 'E']; $str = str_ireplace($search, $replace, strtolower(trim($urlString))); $str = preg_replace('/[^\w\d\-\ ]/', '-', $str); $str = str_replace(' ', '-', $str); return preg_replace('/\-{2,}/', '-', $str); } @endphp