Stories
-
@foreach($stories as $story)
@php
if ($story->first()->isBusiness == 1) {
$user = Business::where('businessId', $story->first()->userId)->first();
$userName = $user->businessName ?? '';
$userImage = $user->logoImageUrl;
$userPic = env('APPLICATION_URL') . ($user->logoImageUrl ?? '');
$userId = $user->businessId;
} else {
$user = MstUser::where('userId', $story->first()->userId)->first();
$userName = $user->userName ?? '';
$userImage = $user->profileImageUrl;
$userPic = env('APPLICATION_URL') . ($user->profileImageUrl ?? '');
$userId = $story->first()->userId;
}
@endphp
-
@if(\Illuminate\Support\Facades\File::exists(public_path($userImage))) @else @endif
{{$userName??''}}
{{ \Carbon\Carbon::parse($story->first()->posted_date)->diffForHumans() }}
@endforeach
@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)
@endif
@endforeach
@if(\Illuminate\Support\Facades\File::exists(public_path($userImage)))
@else
@endif