@php
$totalDocuments = ($user->clientDocuments) ? count($user->clientDocuments) : 0;
$permission = 0; // assuming we do have permission for all uploaded files
@endphp
@forelse($employee->documents as $file)
@if ($viewDocumentPermission == 'all'
|| ($viewDocumentPermission == 'added' && $file->added_by == user()->id)
|| ($viewDocumentPermission == 'owned' && ($file->user_id == user()->id && $file->added_by != user()->id))
|| ($viewDocumentPermission == 'both' && ($file->added_by == user()->id || $file->user_id == user()->id)))
@else
@php
$permission++;
@endphp
@endif
@empty
- @lang('messages.noFileUploaded')
@endforelse
@if (isset($user->clientDocuments) && $totalDocuments > 0 && $totalDocuments == $permission)
- @lang('messages.noFileUploaded') -