@php $briefComments = $brief->comments ?? collect(); $canComment = auth()->user()->hasRole('admin') || auth()->user()->employer; $myInitials = collect(explode(' ', (string) (auth()->user()->name ?? 'U')))->filter()->take(2)->map(fn ($w) => mb_strtoupper(mb_substr($w, 0, 1)))->implode('') ?: 'U'; @endphp

Commentaires

{{ $briefComments->count() }} publication(s)

@if($canComment)
@csrf
{{ $myInitials }}
@endif
@forelse($briefComments as $comment) @php $authorName = $comment->employer?->user?->name ?? 'Employe'; $commentInitials = collect(explode(' ', $authorName))->filter()->take(2)->map(fn ($w) => mb_strtoupper(mb_substr($w, 0, 1)))->implode('') ?: 'E'; @endphp
{{ $commentInitials }}

{{ $authorName }}

@if($comment->comment)

{{ $comment->comment }}

@endif @if($comment->images && $comment->images->isNotEmpty())
@foreach($comment->images as $image) @php $imgUrl = route('employer-briefs.comments.images.show', ['brief' => $brief, 'image' => $image]); @endphp @endforeach
@endif

{{ $comment->created_at?->diffForHumans() }}

@empty

Aucun commentaire. Soyez le premier a reagir.

@endforelse