{{-- Loop through the feature_details array and display the icons --}} @foreach ($feature_details as $feature) @if (in_array($feature->type, ['tel', 'email', 'instagram', 'snapchat', 'address'])) {{-- Phone --}} @if ($feature->type == 'tel') @endif {{-- Email --}} @if ($feature->type == 'email') @endif {{-- Location --}} @if ($feature->type == 'address') @endif {{-- Snapchat --}} @if ($feature->type == 'snapchat') @endif {{-- Instagram --}} @if ($feature->type == 'instagram') @endif @endif @endforeach
{{-- Location --}} @foreach ($feature_details as $feature) @if (in_array($feature->type, ['address']))

{{ $feature->label }}

{{ $feature->content }}

@endif @endforeach @php // List of excluded feature types $excludedTypes = ['email', 'tel', 'instagram', 'snapchat', 'address', 'map', 'iframe', 'youtube']; // Filter the features to include only valid ones $validFeatures = collect($feature_details)->filter(function ($feature) use ($excludedTypes) { return isset($feature->type) && !in_array($feature->type, $excludedTypes); }); @endphp @if ($validFeatures->isNotEmpty())

{{ __('Social Links') }}

@foreach ($validFeatures as $feature) {{-- Generate href value dynamically --}} @php $href = $feature->content; if ($feature->type == 'wa') { $href = 'https://wa.me/' . $feature->content; } elseif ($feature->type == 'email') { $href = 'mailto:' . $feature->content; } elseif ($feature->type == 'text') { $href = 'javascript:void(0);'; } @endphp

{{ $feature->label }}

{{ $feature->content }}

@endforeach
@endif