@extends('theme::layout') @section('title', $post->title) @section('meta_description', Str::limit(strip_tags($post->description), 160)) @section('content')
{{-- Back link --}} ← Back to Blog {{-- Post Header --}}
{{ \Carbon\Carbon::parse($post->post_created_at)->format('d M Y') }} @if($post->category) {{ $post->category->name }} @endif

{{ $post->title }}

{{-- Post Body --}}
{!! $post->description !!}
{{-- Tags --}} @if($post->tags->count())
Tags: @foreach($post->tags as $tag) #{{ $tag->tag_name }} @endforeach
@endif {{-- Post Like --}}
@auth @else Like {{ $post->public_like_count }} @endauth

{{-- Comments Section --}}
{{-- Comment count heading --}}

{{ $comments->total() }} {{ Str::plural('Comment', $comments->total()) }}

{{-- Success flash --}} @if(session('comment_success'))
{{ session('comment_success') }}
@endif {{-- Comment list --}} @if($comments->count())
@foreach($comments as $comment)
{{ strtoupper(substr($comment->user->name ?? $comment->guest_name ?? 'G', 0, 1)) }}
{{ $comment->user->name ?? $comment->guest_name ?? 'Guest' }} {{ \Carbon\Carbon::parse($comment->created_at)->format('d M Y, g:i A') }}

{{ $comment->comments }}

{{-- Comment like --}} @php $commentLiked = in_array($comment->id, $likedComments); @endphp
@endforeach
{{-- Pagination --}} @if($comments->hasPages())
{{ $comments->fragment('comments')->links() }}
@endif @else

No comments yet. Be the first to leave one!

@endif {{-- Add Comment Form --}}

Leave a Comment

@auth @if($errors->any())
@foreach($errors->all() as $error)

{{ $error }}

@endforeach
@endif @php $authProfile = optional(auth()->user()->userprofile); $authName = trim(($authProfile->firstname ?? '') . ' ' . ($authProfile->lastname ?? '')) ?: auth()->user()->name; @endphp

Commenting as {{ $authName }}

@csrf

Comments are moderated before they appear.

@else

You need to be logged in to leave a comment.

@endauth
{{-- end #comments --}}
@endsection @push('scripts') @endpush