@foreach ($userStories as $story) @php $class=""; $text=0; if($story->content_type=='story' && $story->postType=='text'){ if($story->text_back_ground=='red' || $story->text_back_ground=='green' || $story->text_back_ground=='blue'){ $class="story-text-with-bg"; $text=1; } } $user=Business::where('businessId',$userId_)->first(); if($user){ $user=Business::where('businessId',$userId_)->first(); $userName=$user->businessName?? ''; $userImage = $user->logoImageUrl; $userPic=env('APPLICATION_URL').$user->logoImageUrl; }else{ $user=MstUser::where('userId',$userId_)->first(); $userName=$user->userName??''; $userImage = $user->profileImageUrl; $userPic=env('APPLICATION_URL').$user->profileImageUrl; } @endphp
@foreach ($story->postImage as $image) @php $fileType = mime_content_type($image->postFileUrl); $url=env('APPLICATION_URL').$image->postFileUrl; if(\Illuminate\Support\Facades\File::exists(public_path($image->postFileUrl))){ $img_url = env('APPLICATION_URL') . $image->postFileUrl; }else{ $img_url = 'https://hapiverse.com/ci_api/public/'. $image->postFileUrl; } @endphp @if (strpos($fileType, 'image/') === 0) @if ($text != 1)

{{ $story->caption }}

@endif @elseif (strpos($fileType, 'video/') === 0) @if ($text != 1)

{{ $story->caption }}

@endif @endif
@endforeach @if($text==1)
@endif
@endforeach