@extends('layouts.landing') @section('title') {{$group->name}} @endsection @section('content')
Back
@if(isset($group->cover_path)) image @elseif($group->cover_path == null) image @elseif($group->cover_path == 'null') image @else image @endif
@if($group->thumbnail_path) image @else image @endif

{{$group->name}}

@if($mentor->user_id == Auth::user()->id) Create meeting Edit group info @endif
@forelse($feeds as $feed)
@php $user = App\Models\User::where('id', $feed->user_id)->first(); @endphp
@if(Auth::user()->id == $feed->user_id)
@endif

{!! preg_replace("~[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]~", "\\0", $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 {{$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)->where('user_id', '<>', Auth::user()->id)->count(); @endphp @if(count($likes) > 0) @if($user_has_liked) Liked @elseif($user_has_unliked) Like @elseif($user_has_not_liked < 1) Like @else 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}}

@php $comment_like_count = App\Models\CommentLike::where('comment_id', $comment->id)->where('feed_id', $feed->id)->where('like', 1)->count(); @endphp @if($comment_like_count > 0 && $comment_like_count < 2) {{$comment_like_count}} like @elseif($comment_like_count > 1) {{$comment_like_count}} likes @else {{$comment_like_count}} like @endif . @php $comment_reply_count = App\Models\CommentReply::where('comment_id', $comment->id)->where('feed_id', $feed->id)->count(); @endphp {{$comment_reply_count}} @if($comment_reply_count <= 1) reply @elseif($comment_reply_count > 1) replies @endif
@php $comment_likes = App\Models\CommentLike::where('comment_id', $comment->id)->where('feed_id', $feed->id)->get(); $user_has_liked_comment = App\Models\CommentLike::where('comment_id', $comment->id)->where('feed_id', $feed->id)->where('user_id', Auth::user()->id)->where('like', 1)->first(); $user_has_unliked_comment = App\Models\CommentLike::where('comment_id', $comment->id)->where('feed_id', $feed->id)->where('user_id', Auth::user()->id)->where('like', 0)->first(); $user_has_not_liked_comment = App\Models\CommentLike::where('comment_id', $comment->id)->where('feed_id', $feed->id)->where('user_id', '<>', Auth::user()->id)->count(); @endphp @if(count($comment_likes) > 0) @if($user_has_liked_comment) @elseif($user_has_unliked_comment) @elseif($user_has_not_liked_comment < 1) @endif @else @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 $comment_reply)
@php $user = App\Models\User::where('id', $comment_reply->user_id)->first(); @endphp
{{$user->first_name}} {{$user->last_name}}
{{$comment_reply->created_at->diffForHumans()}}

{{$comment_reply->comment_reply_body}}

@php $comment_reply_like_count = App\Models\CommentReplyLike::where('comment_reply_id', $comment_reply->id)->where('comment_id', $comment->id)->where('like', 1)->count(); @endphp @if($comment_reply_like_count > 0 && $comment_reply_like_count < 2) {{$comment_reply_like_count}} like @elseif($comment_reply_like_count > 1) {{$comment_reply_like_count}} likes @else {{$comment_reply_like_count}} like @endif
@php $comment_reply_likes = App\Models\CommentReplyLike::where('comment_reply_id', $comment_reply->id)->where('comment_id', $comment->id)->get(); $user_has_liked_comment_reply = App\Models\CommentReplyLike::where('comment_reply_id', $comment_reply->id)->where('comment_id', $comment->id)->where('user_id', Auth::user()->id)->where('like', 1)->first(); $user_has_unliked_comment_reply = App\Models\CommentReplyLike::where('comment_reply_id', $comment_reply->id)->where('comment_id', $comment->id)->where('user_id', Auth::user()->id)->where('like', 0)->first(); $user_has_not_liked_comment_reply = App\Models\CommentReplyLike::where('comment_reply_id', $comment_reply->id)->where('comment_id', $comment->id)->where('user_id', '<>', Auth::user()->id)->count(); @endphp @if(count($comment_reply_likes) > 0) @if($user_has_liked_comment_reply) @elseif($user_has_unliked_comment_reply) @elseif($user_has_not_liked_comment_reply < 1) @endif @else @endif
@empty @endforelse
{{-- @if($all_replies > 2)
Load more replies..
@endif --}}
@empty @endforelse
@if($all_comments > 2)
Load more comments..
@endif
@empty

You haven't posted anything yet

@endforelse
Upcoming Meetings
@forelse ($mentor_meetings as $mentor_meeting)
{{$mentor_meeting->meeting_title}}

{{\Carbon\Carbon::parse($mentor_meeting->meeting_date)->toFormattedDateString()}}

{{$mentor_meeting->meeting_start_time}} - {{$mentor_meeting->meeting_end_time}}

@if($mentor_meeting->meeting_date < now())

Ended

@else

{{$mentor_meeting->meeting_link}}

Scheduled

@endif @if(Auth::user()->id == $mentor->user_id) @if($mentor_meeting->meeting_date >= now()) @php $date = \Carbon\Carbon::parse($mentor_meeting->meeting_date)->toFormattedDateString(); $time = $mentor_meeting->meeting_start_time . ' - ' . $mentor_meeting->meeting_end_time; @endphp
Start Session
@csrf
@elseif($mentor_meeting->meeting_date < now())
@csrf
@endif @endif
@empty

There are no meetings

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

Mentor . {{$review_count}}

@if(Auth::user()->id !== $mentor->user_id) @endif
Mentees
@forelse ($group_mentees as $mentee)
@php $user = App\Models\User::where('id', $mentee->user_id)->first(); $mentee_review_count = App\Models\MentorRating::where('rating_id', $mentee->user_id)->count(); $mentee_rating = App\Models\MentorRating::where('rating_id', $mentee->user_id)->orderBy('user_rating', 'DESC')->first(); @endphp
{{$user->first_name}} {{$user->last_name}}
@if($mentee_rating)

{{$mentee_review_count}} {{getRating($mentee_rating->user_rating)}}

@endif
@if(Auth::user()->id !== $mentee->user_id)
@php $name = $user->first_name . ' ' . $user->last_name; $avatar = $user->avatar; @endphp Rate Mentee
@endif
@empty

No mentees

@endforelse
@include('elements.create-meeting') @include('elements.start-session') @include('elements.mentor-rating') @include('elements.mentee-rating') @include('elements.mentor-post') @include('elements.edit-group') @include('elements.feeds-script') @include('elements.share-feed') @endsection