@extends('layouts.landing') @section('title', 'Feeds') @section('content')
Posted {{$feed->created_at->diffForHumans()}}
{{$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) @elseif(count($photos) > 1 && count($photos) < 3) @elseif(count($photos) > 2 && count($photos) < 4) @elseif(count($photos) > 3 && count($photos) < 5) @elseif(count($photos) > 4) @php $n = 4; // to get the 4th image if the image count is greater than 3 @endphp@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}} like @endif
@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
Share
Comment