@if (!empty($socialMediaShares) && count($socialMediaShares))
@foreach ($socialMediaShares as $share)
@php
$currentUrl = urlencode(url()->current());
$platform = strtolower($share->platform_name);
switch ($platform) {
case 'facebook':
$targetUrl = "https://www.facebook.com/sharer/sharer.php?u=$currentUrl";
break;
case 'twitter':
$targetUrl = "https://twitter.com/intent/tweet?url=$currentUrl";
break;
case 'linkedin':
$targetUrl = "https://www.linkedin.com/sharing/share-offsite/?url=$currentUrl";
break;
case 'whatsapp':
$targetUrl = "https://api.whatsapp.com/send?text=$currentUrl";
break;
case 'telegram':
$targetUrl = "https://t.me/share/url?url=$currentUrl";
break;
default:
$targetUrl = $share->url ?? "#";
}
@endphp
@endforeach
@else
{{ __('No Service Links Available') }}
@endif