@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 }} {{--
--}}
{{ $formattedContact }} {{--