@php $editTaskCommentPermission = user()->permission('edit_task_comments'); $deleteTaskCommentPermission = user()->permission('delete_task_comments'); @endphp @forelse ($comments as $comment)
{{ mb_ucwords($comment->user->name) }}

{{ mb_ucwords($comment->user->name) }}

{{$comment->created_at->timezone(company()->timezone)->diffForHumans()}}
@if ($editTaskCommentPermission == 'all' || ($editTaskCommentPermission == 'added' && $comment->added_by == user()->id)) @endif @if ($deleteTaskCommentPermission == 'all' || ($deleteTaskCommentPermission == 'added' && $comment->added_by == user()->id)) @endif
@php $likeUsers = $comment->likeUsers->pluck('name')->toArray(); $likeUserList = ''; if($likeUsers) { if(in_array(user()->name, $likeUsers)){ $key = array_search(user()->name, $likeUsers); array_splice( $likeUsers, 0, 0, __('modules.tasks.you') ); unset($likeUsers[$key+1]); } $likeUserList = implode(', ', $likeUsers); } $dislikeUsers = $comment->dislikeUsers->pluck('name')->toArray(); $dislikeUserList = ''; if($dislikeUsers) { if(in_array(user()->name, $dislikeUsers)){ $key = array_search (user()->name, $dislikeUsers); array_splice( $dislikeUsers, 0, 0, __('modules.tasks.you') ); unset($dislikeUsers[$key+1]); } $dislikeUserList = implode(', ', $dislikeUsers); } @endphp
{!! ucfirst($comment->comment) !!}
@empty @endforelse