@php $depth = $depth ?? 0; $authorName = $comment->user?->name ?? $comment->guest_name ?? '익명'; $canEditComment = auth('web')->check() ? (auth('web')->id() === $comment->user_id || $board->canEditComments(auth('web')->user())) : ! $comment->user_id; $canDeleteComment = auth('web')->check() ? (auth('web')->id() === $comment->user_id || $board->canDeleteComments(auth('web')->user())) : ! $comment->user_id; @endphp
{{ $authorName }} {{ $comment->created_at->diffForHumans() }} @if ($board->canWriteComments(auth('web')->user())) @endif @if ($canEditComment) @endif @if ($canDeleteComment)
@csrf @method('DELETE') @guest('web') @endguest ×
@endif
{{ $comment->content }}
@if ($comment->children->isNotEmpty())
@foreach ($comment->children as $child) @include('platform.posts.partials.comment-item', ['comment' => $child, 'board' => $board, 'depth' => $depth + 1]) @endforeach
@endif