@extends('layouts.landing') @section('title', 'Feeds') @section('content')
@include('alerts.alerts')
Add story
{{-- --}}
@if (count($my_stories) > 0) @foreach ($my_stories[Auth::user()->id] as $story) @php $add_day = $story->created_at->addDay(1); // remove story after 24 hours $viewed_story_count = App\Models\ViewedStory::where('story_id', $story->id)->count(); $story_created = $story->created_at->diffForHumans(); // dd($story); @endphp @if (now() <= $add_day)
{{ Auth::user()->first_name }} {{ Auth::user()->last_name }}
@endif @endforeach @endif @if (count($user_stories_id) > 0) @foreach ($user_stories_id as $key => $user_id) @foreach ($stories[$key] as $story) @php $add_day = $story->created_at->addDay(1); // remove story after 24 hours $user = App\Models\User::where('id', $story->user_id)->first(); $viewed_story_count = App\Models\ViewedStory::where('story_id', $story->id)->count(); $story_created = $story->created_at->diffForHumans(); @endphp @if (now() <= $add_day)
{{ $user->first_name }} {{ $user->last_name }}
@endif @endforeach @endforeach @endif
@if (isset($feed))
@php $user = App\Models\User::where('id', $feed->user_id)->first(); @endphp
@if (Auth::user()->isModerator()) @if ($feed->general_pinned_post == 0)
@csrf
@elseif($feed->general_pinned_post == 1)
@csrf
@endif @else @if ($feed->general_pinned_post == 1)
Pinned
@endif @endif @if (Auth::user()->id == $feed->user_id) @endif
{{--

{!! preg_replace( '~[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]~', "\\0", $feed->content, ) !!}

--}}
{!! $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 }} like @endif

@php $comment_count = App\Models\Comment::where('feed_id', $feed->id)->count(); @endphp

Share

@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
@if ($all_comments > 2)
@endif
@endif
@forelse($feeds as $feed)
@php $user = App\Models\User::where('id', $feed->user_id)->first(); @endphp
@if (Auth::user()->isModerator()) @if ($feed->general_pinned_post == 0)
@csrf
@elseif($feed->general_pinned_post == 1)
@csrf
@endif @else @if ($feed->general_pinned_post == 1)
Pinned
@endif @endif @if (Auth::user()->id == $feed->user_id) @endif
{{--

{!! preg_replace( '~[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]~', "\\0", $feed->content, ) !!}

--}}
{!! $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 }} like @endif

@php $comment_count = App\Models\Comment::where('feed_id', $feed->id)->count(); @endphp

@if ($feed->edited)

edited

@endif

Share

{{-- --}}
@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
@if ($all_comments > 2)
@endif
@empty

There are currently no posts yet

@endforelse
@if (isset(Auth::user()->cover)) image @elseif(Auth::user()->cover == null) image @else image @endif
image

{{ Auth::user()->first_name }} {{ Auth::user()->last_name }} @if (Auth::user()->creatorId() == Auth::user()->id) @endif

@if (tenantSetting($_SERVER['HTTP_HOST']) !== '') @if (tenantSetting($_SERVER['HTTP_HOST'])->verify_status == 1) @if (Auth::user()->ctb_status == 'verified')

Verified

@elseif(Auth::user()->ctb_status == 'pending')

Verification pending

@else

Verify your profile

@endif @endif @endif
Your Network
@forelse ($users as $user)
@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 Friends

@endforelse
@include('elements.create-post') @include('elements.create-story') @include('elements.story') @include('elements.share-feed') @include('elements.feeds-script') @include('elements.feeds-upload-script') @include('elements.feeds-story-script') @include('elements.followers') @include('elements.following') @include('modals.edit_post_modal') @include('alerts.alerts') @endsection