@php
$socialMedia = [];
foreach ($siteSocialMedia as $key => $value) {
if(!empty($value->url)){
if($value->title == 'facebook'){
$icon = 'fab fa-facebook-f';
$image = 'frontend/assets/social-icons/Facebook.svg';
}elseif($value->title == 'twitter') {
$icon = 'fab fa-twitter';
$image = 'frontend/assets/social-icons/Twitter.svg';
}elseif($value->title == 'instagram') {
$icon = 'fab fa-instagram';
$image = 'frontend/assets/social-icons/Instagram.svg';
}elseif($value->title == '') { //linkedIn
$icon = ''; //'fab fa-linkedin-in';
$image = ""; //'frontend/assets/social-icons/Linkedin.svg';
}elseif($value->title == 'youtube') {
$icon = 'fab fa-youtube';
$image = 'frontend/assets/social-icons/Youtube.svg';
}elseif($value->title == 'tiktok') {
$icon = 'fab fa-tiktok';
$image = 'frontend/assets/social-icons/Tiktok.svg';
}
$socialMedia[$value->title] = ['title' => $value->title, 'link' => $value->url, 'icon' => $icon, 'image' => $image];
}
}
@endphp
@foreach($socialMedia as $key => $value)
@if(!empty($value['link']) && !empty($value['icon']))
-
@if(isset($value['image']) && !empty($value['image']) && file_exists($value['image']))
@else
@endif
@endif
@endforeach