@extends('layout') @section('content')

{{ $post->title }}

Опубликовано: {{ $post->published_at ? $post->published_at->format('d F Y') : 'Не опубликовано' }}
{!! nl2br(e($post->content)) !!}

Комментарии ({{ $post->comments->where('is_approved', true)->count() }})

Оставить комментарий

@csrf
@foreach($post->comments as $comment) @if($comment->is_approved)
{{ substr($comment->author_name, 0, 1) }}
{{ $comment->author_name }}
{{ $comment->created_at->diffForHumans() }}
{{ $comment->body }}
@else @auth
{{ $comment->author_name }} (На модерации)
{{ $comment->body }}
@endauth @endif @endforeach
@endsection