@extends('layouts.app') @section('page-pretitle', __('Documents')) @section('page-title', __('List of Documents')) @section('content') {{-- Flash Messages --}} @if ($errors->any()) @endif @if (session('success')) @endif

{{ __('Search Filter') }}

{{--
@include('asset.entries')
--}}
{{-- --}} @forelse($documents as $i => $doc) @empty @endforelse
# Preview File Name Project Type ActionsView
{{ $documents->firstItem() + $i }} @php $ext = strtolower(pathinfo($doc->path, PATHINFO_EXTENSION)); $isImage = in_array($ext, ['jpg', 'jpeg', 'png']); $isPdf = $ext === 'pdf'; @endphp @if($isImage || $isPdf) {{ $doc->original_name }} @else View Download @endif {{ $doc->original_name }}
{{ strtoupper($doc->project->ref_no ?? '-') }}
{{ strtoupper($doc->project->description ?? '-') }}
@php $ext = strtolower(pathinfo($doc->path, PATHINFO_EXTENSION)); $typeClasses = [ 'pdf' => ['bg' => 'bg-red-lt', 'text' => 'text-red-lt-fg'], 'doc' => ['bg' => 'bg-blue-lt', 'text' => 'text-blue-lt-fg'], 'docx' => ['bg' => 'bg-blue-lt', 'text' => 'text-blue-lt-fg'], 'xls' => ['bg' => 'bg-green-lt', 'text' => 'text-green-lt-fg'], 'xlsx' => ['bg' => 'bg-green-lt', 'text' => 'text-green-lt-fg'], 'jpg' => ['bg' => 'bg-yellow-lt', 'text' => 'text-yellow-lt-fg'], 'jpeg' => ['bg' => 'bg-yellow-lt', 'text' => 'text-yellow-lt-fg'], 'png' => ['bg' => 'bg-yellow-lt', 'text' => 'text-yellow-lt-fg'], 'zip' => ['bg' => 'bg-orange-lt', 'text' => 'text-orange-lt-fg'], 'txt' => ['bg' => 'bg-secondary', 'text' => 'text-dark'], ]; $bgClass = $typeClasses[$ext]['bg'] ?? 'bg-secondary'; $textClass = $typeClasses[$ext]['text'] ?? 'text-dark'; @endphp {{ strtoupper($ext) }}
{{-- Dropdown --}}
No documents found.
@if ($documents->hasPages()) @endif
@endsection @section('script') @endsection