@extends('layouts.app') @section('title', $post->title) @section('content')

{{ $board->name }}

@if($post->is_notice) 공지 @endif @if($post->is_secret) @endif {{ $post->title }}

← 목록으로
작성자: {{ $post->author?->name ?? '알 수 없음' }} 작성일: {{ $post->created_at->format('Y-m-d H:i') }} 조회: {{ number_format($post->views) }}
@if($post->user_id === auth()->id() || auth()->user()->hasRole(['admin', 'super-admin']))
수정
@csrf @method('DELETE')
@endif
@if(!empty($customFieldValues))
@foreach($board->fields as $field) @if(isset($customFieldValues[$field->field_key]))
{{ $field->name }}: {{ $customFieldValues[$field->field_key] }}
@endif @endforeach
@endif @php $imageFiles = $post->files->filter(fn($file) => $file->isImage()); $otherFiles = $post->files->filter(fn($file) => !$file->isImage()); @endphp @if($imageFiles->isNotEmpty())
@foreach($imageFiles as $file) {{ $file->display_name ?? $file->original_name }} @endforeach
@endif
@if($board->editor_type === 'wysiwyg') {{-- WYSIWYG: HTML 허용 (안전한 태그만) --}} {!! $post->getSafeHtmlContent() !!} @elseif($board->editor_type === 'markdown') {{-- Markdown: 파싱 후 출력 --}} {!! Str::markdown($post->content) !!} @else {{-- Text: 일반 텍스트 --}} {!! nl2br(e($post->content)) !!} @endif
@if($otherFiles->isNotEmpty())

첨부파일 ({{ $otherFiles->count() }}개)

@foreach($otherFiles as $file)
{{ $file->display_name ?? $file->original_name }} ({{ $file->getFormattedSize() }})
다운로드
@endforeach
@endif
@if($adjacent['prev'])
이전글 {{ $adjacent['prev']->title }}
@endif @if($adjacent['next'])
다음글 {{ $adjacent['next']->title }}
@endif

댓글 {{ $comments->count() + $comments->sum(fn($c) => $c->replies->count()) }}

@csrf
{{ mb_substr(auth()->user()->name, 0, 1) }}
@error('content')

{{ $message }}

@enderror
@forelse($comments as $comment)
{{ mb_substr($comment->user?->name ?? '?', 0, 1) }}
{{ $comment->user?->name ?? '알 수 없음' }} {{ $comment->created_at->diffForHumans() }} @if($comment->created_at != $comment->updated_at) (수정됨) @endif

{{ $comment->content }}

@if($comment->user_id === auth()->id() || auth()->user()->hasRole(['admin', 'super-admin']))
@csrf @method('DELETE')
@endif
@csrf @method('PUT')
@if($comment->replies->isNotEmpty())
@foreach($comment->replies as $reply)
{{ mb_substr($reply->user?->name ?? '?', 0, 1) }}
{{ $reply->user?->name ?? '알 수 없음' }} {{ $reply->created_at->diffForHumans() }}

{{ $reply->content }}

@if($reply->user_id === auth()->id() || auth()->user()->hasRole(['admin', 'super-admin']))
@csrf @method('DELETE')
@endif
@csrf @method('PUT')
@endforeach
@endif
@csrf
@empty

아직 댓글이 없습니다.

첫 번째 댓글을 작성해보세요!

@endforelse
목록
@if(session('success'))
{{ session('success') }}
@endif @endsection