@php /** @var \Illuminate\Support\Collection $lessonComments */ $lessonComments = $lessonComments ?? collect(); @endphp

コメント

@if($lessonComments->isNotEmpty()) @php // コメントは受講者が増やすので上限がある。**黙って打ち切らず**件数を出す。 $lessonCommentTotal = $lessonCommentTotal ?? $lessonComments->count(); $lessonCommentMax = \App\Services\MembershipSite\MembershipSiteLessonCommentService::MAX_COMMENTS_PER_LESSON; @endphp @if($lessonCommentTotal > $lessonCommentMax)

全 {{ number_format($lessonCommentTotal) }} 件のうち、最新 {{ number_format($lessonCommentMax) }} 件を表示しています。

@endif
@foreach($lessonComments as $comment)
{{ $comment->author_name }}

{{ $comment->body }}

@if(filled($comment->admin_reply))
{{ $comment->admin_reply_author_name ?: '運営' }} からの返信

{{ $comment->admin_reply }}

@endif
@endforeach
@else

まだコメントはありません。最初のコメントを投稿してみましょう。

@endif

コメントを投稿

@if($errors->any())
    @foreach($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif
@csrf