@extends('layouts.tenant') @section('title', 'Documents') @section('content')

Documents

Manage and process your documents

New Document
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif @if($stats)

Total Documents

{{ number_format($stats['total']) }}

Processed

{{ number_format($stats['processed']) }}

Pending

{{ number_format($stats['pending']) }}

Failed

{{ $stats['failed'] ?? 0 }}

Storage Used

{{ number_format(($stats['storage_used'] ?? 0) / 1024 / 1024, 1) }}MB

@endif

Documents

@if($documents->count() > 0)
@endif
@if($documents->count() > 0)
@foreach($documents as $document) @endforeach
Document Type Size Status Date Actions
@php $extension = strtolower(pathinfo($document->name, PATHINFO_EXTENSION)); $iconClass = match($extension) { 'pdf' => 'text-red-600', 'doc', 'docx' => 'text-blue-600', 'xls', 'xlsx' => 'text-green-600', 'jpg', 'jpeg', 'png', 'gif' => 'text-purple-600', default => 'text-gray-600' }; @endphp
{{ Str::limit($document->name, 40) }}
@if($document->description)
{{ Str::limit($document->description, 60) }}
@endif
@php $typeLabels = [ 'invoice' => 'Invoice', 'receipt' => 'Receipt', 'contract' => 'Contract', 'report' => 'Report', 'other' => 'Other' ]; $typeColors = [ 'invoice' => 'bg-blue-100 text-blue-800 border-blue-200', 'receipt' => 'bg-green-100 text-green-800 border-green-200', 'contract' => 'bg-purple-100 text-purple-800 border-purple-200', 'report' => 'bg-yellow-100 text-yellow-800 border-yellow-200', 'other' => 'bg-gray-100 text-gray-800 border-gray-200' ]; @endphp {{ $typeLabels[$document->type] ?? ucfirst($document->type) }} {{ number_format($document->size / 1024, 1) }} KB @php $statusClasses = [ 'pending' => 'bg-yellow-100 text-yellow-800 border-yellow-200', 'processing' => 'bg-blue-100 text-blue-800 border-blue-200', 'processed' => 'bg-green-100 text-green-800 border-green-200', 'failed' => 'bg-red-100 text-red-800 border-red-200', ]; $statusLabels = [ 'pending' => 'Pending', 'processing' => 'Processing', 'processed' => 'Processed', 'failed' => 'Failed', ]; @endphp {{ $statusLabels[$document->status] ?? ucfirst($document->status) }}
{{ $document->created_at->format('M d, Y') }}
{{ $document->created_at->format('H:i') }}
@if($document->status === 'pending' || $document->status === 'failed') @endif
@if($documents->hasPages())
{{ $documents->appends(request()->query())->links() }}
@endif @else

No Documents Found

@if(request()->hasAny(['search', 'type', 'status', 'date_from'])) No documents match your current filters. Try adjusting your search criteria or clear the filters to see all documents. @else You haven't uploaded any documents yet. Start by uploading your first document to get started with document management. @endif

@endif
@endsection