@extends('layouts.app') @section('mobile-title', 'Document Centre') @section('mobile-subtitle', 'Folders and company files') @section('mobile-action-url', route('documents.upload.create')) @section('mobile-action-icon', 'upload') @section('mobile-action-label', 'Upload documents') @section('content') @php $folderCount = $folders->total(); $uploadFolder = $quickAccessFolders->first() ?? $folders->getCollection()->first(); $fileIcon = function ($document) { $mime = $document->mime_type ?? ''; $name = strtolower($document->original_name ?? ''); return match (true) { str_contains($mime, 'pdf') || str_ends_with($name, '.pdf') => ['picture_as_pdf', 'text-red-700', 'PDF'], str_starts_with($mime, 'image/') => ['image', 'text-[var(--construct-secondary)]', 'IMG'], str_contains($mime, 'spreadsheet') || str_ends_with($name, '.csv') || str_ends_with($name, '.xlsx') => ['table_chart', 'text-emerald-800', 'XLS'], str_contains($mime, 'word') || str_ends_with($name, '.doc') || str_ends_with($name, '.docx') => ['description', 'text-[var(--construct-secondary)]', 'DOC'], str_contains($mime, 'message') || str_ends_with($name, '.eml') => ['mail', 'text-[var(--construct-secondary)]', 'EML'], default => ['draft', 'text-emerald-800', 'FILE'], }; }; @endphp

Document Centre

Root chevron_right All company records
@can('create', \App\Models\DocumentFolder::class) create_new_folder New Folder @endcan @if ($uploadFolder) edit_document Create Document upload Upload @endif @if (auth()->user()->isAdmin()) verified_user Compliance @endif

Quick Access Folders

{{ $folderCount }} folder{{ $folderCount === 1 ? '' : 's' }} available to you

@forelse ($quickAccessFolders as $folder)
folder_open more_vert
{{ $folder->name }}
{{ $folder->documents_count }} file{{ $folder->documents_count === 1 ? '' : 's' }}
{{ $folder->categoryLabel() }}
@empty
No document folders are available yet.
@endforelse
Reset
@if ($expiringDocuments->isNotEmpty())
release_alert Expiring documents
@foreach ($expiringDocuments->take(8) as $document) {{ $document->title }} {{ $document->folder->name }} · {{ $document->expires_at->format('M j, Y') }} @endforeach
@endif

Recent Files

Showing {{ $recentDocuments->count() }} of {{ $visibleDocumentCount }} visible files

@forelse ($recentDocuments as $document) @php [$icon, $iconColor, $fileKind] = $fileIcon($document); @endphp @empty @endforelse
Name Owner Modified date Size Status
{{ $icon }} {{ $document->title }} {{ $fileKind }} · {{ $document->folder->name }}
{{ collect(explode(' ', $document->owner?->name ?? $document->uploader->name))->filter()->map(fn ($part) => substr($part, 0, 1))->take(2)->implode('') }} {{ $document->owner?->name ?? $document->uploader->name }}
{{ $document->updated_at->format('M j, Y') }} {{ number_format($document->size / 1048576, 2) }} MB @include('partials.status-badge', ['status' => $document->status])
No recent files are visible.
Showing {{ $recentDocuments->count() }} of {{ $visibleDocumentCount }} files
chevron_left chevron_right

All Folders

@forelse ($folders as $folder)
folder_open {{ $folder->name }} {{ $folder->categoryLabel() }} @if ($folder->parent) · Inside {{ $folder->parent->name }} @endif @if ($folder->owner) · Owner {{ $folder->owner->name }} @endif @if ($folder->project) · {{ $folder->project->name }} @endif · {{ $folder->documents_count }} file{{ $folder->documents_count === 1 ? '' : 's' }}
{{ $folder->updated_at->diffForHumans() }}
@include('partials.status-badge', ['status' => $folder->archived_at ? 'archived' : 'active'])
@empty
No document folders available.
@endforelse
{{ $folders->links() }}
@endsection