@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?? ''; $userPic='https://hapiverse.com/'.$user->logoImageUrl; }else{ $user=MstUser::where('userId',$userId_)->first(); $userName=$user->userName??''; $userPic='https://hapiverse.com/'; } @endphp
@foreach ($story->postImage as $image) @php $url='https://hapiverse.com/'.$image->postFileUrl; @endphp @if($text!=1)

{{$story->caption}}

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