@extends('layouts.app') @section('page-title', 'Search Documents') @section('content') {{-- index.blade.php uses Bootstrap Icons (bi bi-*) throughout. If your layout already loads them, delete this line. --}} @php // "Home / Folder / Subfolder" for the folder that CONTAINS an item. $locationLabel = function ($containingFolder) { if (!$containingFolder) return 'Home'; return 'Home / ' . collect($containingFolder->breadcrumbs())->pluck('name')->implode(' / '); }; $uploaderName = function ($uploader) { if (!$uploader) return 'Unknown'; $full = trim(($uploader->first_name ?? '') . ' ' . ($uploader->last_name ?? '')); return $full !== '' ? $full : ($uploader->name ?? 'Unknown'); }; $total = $folders->count() + $files->count(); @endphp

Search Documents

Back to repository @if($q !== '') / {{ $total }} result{{ $total === 1 ? '' : 's' }} for “{{ $q }}” @endif
@if($q === '')
Type a name above to search files and folders.
@elseif($total === 0)
Nothing matched “{{ $q }}”.
@else @if($folders->isNotEmpty())
Folders ({{ $folders->count() }})
@foreach($folders as $f) @php $restricted = $f->roles->isNotEmpty(); @endphp
@if($restricted) @endif
{{ $f->name }}
in @if($f->parent_id) {{ $locationLabel($f->parent) }} @else Home @endif @if($canManage) · {{ $restricted ? 'Restricted: ' . $f->roleNames() : 'Inherits parent access' }} @endif
@endforeach @endif @if($files->isNotEmpty())
Files ({{ $files->count() }})
@foreach($files as $file) @php $restricted = $file->roles->isNotEmpty(); @endphp
@if($restricted) @endif
{{ $file->name }}
{{ $file->human_size }} · {{ $uploaderName($file->uploader) }} · in @if($file->folder_id) {{ $locationLabel($file->folder) }} @else Home @endif @if($canManage) · {{ $restricted ? 'Restricted: ' . $file->roleNames() : 'Inherits folder access' }} @endif
@endforeach @endif @endif
@endsection