@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
{{ $folderCount }} folder{{ $folderCount === 1 ? '' : 's' }} available to you
Showing {{ $recentDocuments->count() }} of {{ $visibleDocumentCount }} visible files
| 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. | ||||