@php use Botble\Base\Facades\BaseHelper; use Botble\Media\Facades\RvMedia; use Botble\Shortcode\Facades\Shortcode; $heading = (string) ($shortcode->heading ?? ''); $subtitle = (string) ($shortcode->subtitle ?? ''); $items = Shortcode::fields()->getTabsData(['image', 'name', 'role', 'social_links'], $shortcode); $resolveImage = static fn (?string $path): string => $path ? RvMedia::getImageUrl($path, null, false, RvMedia::getDefaultImage()) : RvMedia::getDefaultImage(); // Default social icons used when the member's `social_links` is empty. $defaultSocials = [ ['url' => 'https://www.facebook.com/', 'icon' => 'icon-FacebookLogo', 'label' => 'Facebook'], ['url' => 'https://x.com/', 'icon' => 'icon-XLogo', 'label' => 'X / Twitter'], ['url' => 'https://www.instagram.com/', 'icon' => 'icon-InstagramLogo', 'label' => 'Instagram'], ['url' => 'https://www.tiktok.com/', 'icon' => 'icon-TiktokLogo', 'label' => 'TikTok'], ]; // Member-level `social_links` may be JSON `{"icon-FacebookLogo": "https://..."}` // mapping or a comma-separated url list — both fall back to defaults if empty. $resolveSocials = static function (?string $raw) use ($defaultSocials): array { if (! $raw) { return $defaultSocials; } $decoded = json_decode($raw, true); if (is_array($decoded) && $decoded) { $out = []; foreach ($decoded as $icon => $url) { $out[] = ['url' => $url, 'icon' => $icon, 'label' => $icon]; } return $out; } return $defaultSocials; }; @endphp {{-- .card-member-v01 image-style + member-info rules live in assets/sass/component/_inline-migrated.scss. --}}
htmlAttributes() !!} class="flat-spacing pt-0">
@if ($heading || $subtitle)
@if ($heading)

{{ $heading }}

@endif @if ($subtitle)

{!! BaseHelper::clean($subtitle) !!}

@endif
@endif
@foreach ($items as $member) @php($socials = $resolveSocials($member['social_links'] ?? null))
@if (! empty($member['image']))
{{ $member['name'] ?? '' }}
@endif
@if (! empty($member['name'])) {{ $member['name'] }} @endif @if (! empty($member['role']))

{{ $member['role'] }}

@endif
@endforeach