@php $viewInvoiceFilePermission = user()->permission('view_invoices'); $deleteInvoiceFilePermission = user()->permission('delete_invoices'); @endphp @forelse($files as $file) @if ($viewInvoiceFilePermission == 'all' || ($viewInvoiceFilePermission == 'added' && $file->added_by == user()->id)) @endif @empty @endforelse