@extends('layouts.landing') @section('title') {{$search}} @endsection @section('content')
@forelse($feeds as $feed)
@php $user = App\Models\User::where('id', $feed->user_id)->first(); @endphp
{{$user->first_name}} {{$user->last_name}}

Posted {{$feed->created_at->diffForHumans()}}

@if(Auth::user()->id == $feed->user_id)
@endif

{{$feed->content}}

@php $photos = json_decode($feed->photo_path); if($photos) { $photo_count = count($photos); } @endphp @if($photos) @if(count($photos) > 0 && count($photos) < 2)
@foreach ($photos as $photo)
image
@endforeach
@elseif(count($photos) > 1 && count($photos) < 3)
@foreach ($photos as $photo)
image
@endforeach
@elseif(count($photos) > 2 && count($photos) < 4)
@foreach ($photos as $photo)
image
@endforeach
@elseif(count($photos) > 3 && count($photos) < 5)
@foreach ($photos as $photo)
image
@endforeach
@elseif(count($photos) > 4) @php $n = 4; // to get the 4th image if the image count is greater than 3 @endphp
@foreach ($photos as $key => $photo) @if (in_array($key, [0,1,2,3])) @if(($key + 1) % $n)
image
@else @endif @endif @endforeach
@endif @endif @if($feed->video_path)
@endif @if($feed->file_path) @endif

@php $like_count = App\Models\Like::where('feed_id', $feed->id)->where('like', 1)->count(); @endphp @if($like_count > 0 && $like_count < 2) {{$like_count}} like @elseif($like_count > 1) {{$like_count}} likes @else {{$like_count}} likes @endif

{{--

10 Shares

--}}

@php $comment_count = App\Models\Comment::where('feed_id', $feed->id)->count(); @endphp {{$comment_count}} @if($comment_count <= 1) comment @elseif($comment_count > 1) comments @endif

@php $likes = App\Models\Like::where('feed_id', $feed->id)->get(); $user_has_liked = App\Models\Like::where('feed_id', $feed->id)->where('user_id', Auth::user()->id)->where('like', 1)->first(); $user_has_unliked = App\Models\Like::where('feed_id', $feed->id)->where('user_id', Auth::user()->id)->where('like', 0)->first(); $user_has_not_liked = App\Models\Like::where('feed_id', $feed->id)->first(); @endphp @if(count($likes) > 0) @if($user_has_liked) Liked @elseif($user_has_unliked) Like @elseif($user_has_not_liked) Like @endif @else Like @endif

Share

Comment

@csrf
@php $comments = App\Models\Comment::where('feed_id', $feed->id)->orderBy('created_at', 'ASC')->limit(2)->get(); $all_comments = App\Models\Comment::where('feed_id', $feed->id)->count(); @endphp
@if(count($comments) > 0)
Most recent
@endif @forelse($comments as $comment)
@php $user = App\Models\User::where('id', $comment->user_id)->first(); @endphp
{{$user->first_name}} {{$user->last_name}}
{{$comment->created_at->diffForHumans()}}

{{$comment->comment_body}}

2 Likes . @php $reply_count = App\Models\CommentReply::where('comment_id', $comment->id)->where('feed_id', $feed->id)->count(); @endphp {{$reply_count}} @if($reply_count <= 1) reply @elseif($reply_count > 1) replies @endif Reply
@csrf
@php $comment_replies = App\Models\CommentReply::where('comment_id', $comment->id)->orderBy('created_at', 'ASC')->get(); $all_replies = App\Models\CommentReply::where('comment_id', $comment->id)->count(); @endphp
@forelse($comment_replies as $reply)
@php $user = App\Models\User::where('id', $reply->user_id)->first(); @endphp
@empty @endforelse
{{-- @if($all_replies > 2)
Load more replies..
@endif --}}
@empty @endforelse
@if($all_comments > 2)
Load more comments..
@endif
@empty

No result was found

@endforelse
@forelse ($users as $user)
{{$user->first_name}} {{$user->last_name}}

@php $follows = App\Models\Follower::where('followed_user_id', Auth::user()->id)->where('user_id', $user->id)->where('follow_status', 1)->first(); @endphp @if($follows) Follows you . {{$user->state}}, {{$user->country}} @else {{$user->state}}, {{$user->country}} @endif

@php $followers = App\Models\Follower::where('user_id', Auth::user()->id)->get(); $user_has_followed = App\Models\Follower::where('followed_user_id', $user->id)->where('user_id', Auth::user()->id)->where('follow_status', 1)->first(); $user_has_unfollowed = App\Models\Follower::where('followed_user_id', $user->id)->where('user_id', Auth::user()->id)->where('follow_status', 0)->first(); $user_has_not_followed = App\Models\Follower::where('user_id', Auth::user()->id)->first(); @endphp @if(count($followers) > 0) @if($user_has_followed) Following
@empty

No User found

@endforelse
@forelse($announcements as $feed)
@php $user = App\Models\User::where('id', $feed->user_id)->first(); @endphp
{{$user->first_name}} {{$user->last_name}}

Posted {{$feed->created_at->diffForHumans()}}

@if(Auth::user()->id == $feed->user_id)
@endif

{{$feed->content}}

@php $photos = json_decode($feed->photo_path); if($photos) { $photo_count = count($photos); } @endphp @if($photos) @if(count($photos) > 0 && count($photos) < 2)
@foreach ($photos as $photo)
image
@endforeach
@elseif(count($photos) > 1 && count($photos) < 3)
@foreach ($photos as $photo)
image
@endforeach
@elseif(count($photos) > 2 && count($photos) < 4)
@foreach ($photos as $photo)
image
@endforeach
@elseif(count($photos) > 3 && count($photos) < 5)
@foreach ($photos as $photo)
image
@endforeach
@elseif(count($photos) > 4) @php $n = 4; // to get the 4th image if the image count is greater than 3 @endphp
@foreach ($photos as $key => $photo) @if (in_array($key, [0,1,2,3])) @if(($key + 1) % $n)
image
@else @endif @endif @endforeach
@endif @endif @if($feed->video_path)
@endif @if($feed->file_path) @endif

@php $like_count = App\Models\Like::where('feed_id', $feed->id)->where('like', 1)->count(); @endphp @if($like_count > 0 && $like_count < 2) {{$like_count}} like @elseif($like_count > 1) {{$like_count}} likes @else {{$like_count}} likes @endif

{{--

10 Shares

--}}

@php $comment_count = App\Models\Comment::where('feed_id', $feed->id)->count(); @endphp {{$comment_count}} @if($comment_count <= 1) comment @elseif($comment_count > 1) comments @endif

@php $likes = App\Models\Like::where('feed_id', $feed->id)->get(); $user_has_liked = App\Models\Like::where('feed_id', $feed->id)->where('user_id', Auth::user()->id)->where('like', 1)->first(); $user_has_unliked = App\Models\Like::where('feed_id', $feed->id)->where('user_id', Auth::user()->id)->where('like', 0)->first(); $user_has_not_liked = App\Models\Like::where('feed_id', $feed->id)->first(); @endphp @if(count($likes) > 0) @if($user_has_liked) Liked @elseif($user_has_unliked) Like @elseif($user_has_not_liked) Like @endif @else Like @endif

Share

Comment

@csrf
@php $comments = App\Models\Comment::where('feed_id', $feed->id)->orderBy('created_at', 'ASC')->limit(2)->get(); $all_comments = App\Models\Comment::where('feed_id', $feed->id)->count(); @endphp
@if(count($comments) > 0)
Most recent
@endif @forelse($comments as $comment)
@php $user = App\Models\User::where('id', $comment->user_id)->first(); @endphp
{{$user->first_name}} {{$user->last_name}}
{{$comment->created_at->diffForHumans()}}

{{$comment->comment_body}}

2 Likes . @php $reply_count = App\Models\CommentReply::where('comment_id', $comment->id)->where('feed_id', $feed->id)->count(); @endphp {{$reply_count}} @if($reply_count <= 1) reply @elseif($reply_count > 1) replies @endif Reply
@csrf
@php $comment_replies = App\Models\CommentReply::where('comment_id', $comment->id)->orderBy('created_at', 'ASC')->get(); $all_replies = App\Models\CommentReply::where('comment_id', $comment->id)->count(); @endphp
@forelse($comment_replies as $reply)
@php $user = App\Models\User::where('id', $reply->user_id)->first(); @endphp
@empty @endforelse
{{-- @if($all_replies > 2)
Load more replies..
@endif --}}
@empty @endforelse
@if($all_comments > 2)
Load more comments..
@endif
@empty

No result was found

@endforelse
@forelse($forums as $feed)
@php $user = App\Models\User::where('id', $feed->user_id)->first(); @endphp
{{$user->first_name}} {{$user->last_name}}

Posted {{$feed->created_at->diffForHumans()}}

@if(Auth::user()->id == $feed->user_id)
@endif

{{$feed->content}}

@php $photos = json_decode($feed->photo_path); if($photos) { $photo_count = count($photos); } @endphp @if($photos) @if(count($photos) > 0 && count($photos) < 2)
@foreach ($photos as $photo)
image
@endforeach
@elseif(count($photos) > 1 && count($photos) < 3)
@foreach ($photos as $photo)
image
@endforeach
@elseif(count($photos) > 2 && count($photos) < 4)
@foreach ($photos as $photo)
image
@endforeach
@elseif(count($photos) > 3 && count($photos) < 5)
@foreach ($photos as $photo)
image
@endforeach
@elseif(count($photos) > 4) @php $n = 4; // to get the 4th image if the image count is greater than 3 @endphp
@foreach ($photos as $key => $photo) @if (in_array($key, [0,1,2,3])) @if(($key + 1) % $n)
image
@else @endif @endif @endforeach
@endif @endif @if($feed->video_path)
@endif @if($feed->file_path) @endif

@php $like_count = App\Models\Like::where('feed_id', $feed->id)->where('like', 1)->count(); @endphp @if($like_count > 0 && $like_count < 2) {{$like_count}} like @elseif($like_count > 1) {{$like_count}} likes @else {{$like_count}} likes @endif

{{--

10 Shares

--}}

@php $comment_count = App\Models\Comment::where('feed_id', $feed->id)->count(); @endphp {{$comment_count}} @if($comment_count <= 1) comment @elseif($comment_count > 1) comments @endif

@php $likes = App\Models\Like::where('feed_id', $feed->id)->get(); $user_has_liked = App\Models\Like::where('feed_id', $feed->id)->where('user_id', Auth::user()->id)->where('like', 1)->first(); $user_has_unliked = App\Models\Like::where('feed_id', $feed->id)->where('user_id', Auth::user()->id)->where('like', 0)->first(); $user_has_not_liked = App\Models\Like::where('feed_id', $feed->id)->first(); @endphp @if(count($likes) > 0) @if($user_has_liked) Liked @elseif($user_has_unliked) Like @elseif($user_has_not_liked) Like @endif @else Like @endif

Share

Comment

@csrf
@php $comments = App\Models\Comment::where('feed_id', $feed->id)->orderBy('created_at', 'ASC')->limit(2)->get(); $all_comments = App\Models\Comment::where('feed_id', $feed->id)->count(); @endphp
@if(count($comments) > 0)
Most recent
@endif @forelse($comments as $comment)
@php $user = App\Models\User::where('id', $comment->user_id)->first(); @endphp
{{$user->first_name}} {{$user->last_name}}
{{$comment->created_at->diffForHumans()}}

{{$comment->comment_body}}

2 Likes . @php $reply_count = App\Models\CommentReply::where('comment_id', $comment->id)->where('feed_id', $feed->id)->count(); @endphp {{$reply_count}} @if($reply_count <= 1) reply @elseif($reply_count > 1) replies @endif Reply
@csrf
@php $comment_replies = App\Models\CommentReply::where('comment_id', $comment->id)->orderBy('created_at', 'ASC')->get(); $all_replies = App\Models\CommentReply::where('comment_id', $comment->id)->count(); @endphp
@forelse($comment_replies as $reply)
@php $user = App\Models\User::where('id', $reply->user_id)->first(); @endphp
@empty @endforelse
{{-- @if($all_replies > 2)
Load more replies..
@endif --}}
@empty @endforelse
@if($all_comments > 2)
Load more comments..
@endif
@empty

No result was found

@endforelse
Search filters
@if(tenantSetting($_SERVER['HTTP_HOST']) !== '') @if(tenantSetting($_SERVER['HTTP_HOST'])->verify_status == 1)
@endif @endif @if(count($locations) > 0)
@endif
@include('elements.ask-question') @include('elements.feeds-script') @endsection