@php $contactNumber = getDataBySlug('Widget', 'contact-number', 'content'); $emailAddress = getDataBySlug('Widget', 'email-address', 'content'); $fullAddress = getDataBySlug('Widget', 'full-address', 'content'); $openCloseTime = getDataBySlug('Widget', 'open-close-time', 'content'); @endphp
@php $contact = $contactNumber->content ?? '-'; $formattedContact = '-'; if ($contact !== '-') { // Find the position of the prefixes $position = false; $prefixes = ['017', '018', '019', '015', '016', '013', '014']; foreach ($prefixes as $prefix) { $position = strpos($contact, $prefix); if ($position !== false) { break; } } // Extract the 11-digit number starting from the prefix if ($position !== false) { $formattedContact = substr($contact, $position, 11); } } @endphp Call Anytime
{{ $formattedContact }}
{{--
--}}