@php $frequence = $radio->frequence ?? ''; $frequenceFormatted = Str::contains(Str::lower($frequence), 'hz') ? $frequence : $frequence . ' MHz'; $frequenceLength = Str::length($frequenceFormatted); $maxCityLength = 26 - $frequenceLength - 3; // 3 pour ' - ' $cityFormatted = Str::title($city); $cityTruncated = Str::limit($cityFormatted, $maxCityLength, '...'); $fullName = Str::title($radio->name); $truncatedName = Str::words($fullName, 10, '...'); $nameWasTruncated = Str::length($fullName) > Str::length($truncatedName); $fullCity = Str::title($city); $truncatedCity = Str::limit($fullCity, $maxCityLength, '...'); $cityWasTruncated = Str::length($fullCity) > Str::length($truncatedCity); @endphp