@php $addTaskFilePermission = user()->permission('add_task_files'); $viewTaskFilePermission = user()->permission('view_task_files'); $deleteTaskFilePermission = user()->permission('delete_task_files'); @endphp
@if ($addTaskFilePermission == 'all' || ($addTaskFilePermission == 'added' && $task->added_by == user()->id) || ($addTaskFilePermission == 'owned' && in_array(user()->id, $taskUsers)) || ($addTaskFilePermission == 'both' && (in_array(user()->id, $taskUsers) || $task->added_by == user()->id)) )
@lang('app.cancel')
@endif
@php $filesShowCount = 0; // This is done because if fies uploaded and not have permission to view then no record found message should be shown @endphp @forelse($task->files as $file) @if ($viewTaskFilePermission == 'all' || ($viewTaskFilePermission == 'added' && $file->added_by == user()->id)) @php $filesShowCount++; @endphp @if ($file->icon == 'images') @else @endif @endif @empty @endforelse @if ($filesShowCount == 0 && $task->files->count() > 0) @endif