{{-- Trash Table Component ===================== Shared blade for all modules' trash management. Included automatically by HasTrash trait. Variables passed: - $items (paginated collection of trashed records) - $columns (array of column names to display) - $routePrefix (route name prefix, e.g., 'admin.inventory.products') - $trashTitle (page heading) - $trashCount (total trashed count) - $search (current search term) --}}
{{ $trashTitle }} @if($trashCount > 0) {{ $trashCount }} @endif
@if($trashCount > 0) @endif Back to List
{{-- Search --}}
@if($search) @endif
@if($items->count() > 0)
@foreach($columns as $col) @endforeach @foreach($items as $item) @foreach($columns as $col) @endforeach @endforeach
#{{ ucwords(str_replace(['_', '.'], ' ', $col)) }}Actions
{{ $item->id }} @if($col === 'deleted_at') {{ $item->deleted_at->diffForHumans() }} @elseif(str_contains($col, '.')) {{-- Relationship column: e.g., category.name --}} @php [$rel, $field] = explode('.', $col, 2); @endphp {{ optional($item->{$rel})->{$field} ?? '-' }} @else {{ $item->{$col} ?? '-' }} @endif {{-- Restore Button --}}
@csrf
{{-- Permanent Delete Button --}}
{{-- Pagination --}} @if($items->hasPages())
Showing {{ $items->firstItem() }}-{{ $items->lastItem() }} of {{ $items->total() }} {{ $items->links() }}
@endif @else

Trash is empty.

@endif
{{-- ============================================= --}} {{-- MODAL: Permanent Delete Single Record --}} {{-- ============================================= --}} {{-- ============================================= --}} {{-- MODAL: Empty Entire Trash --}} {{-- ============================================= --}} {{-- ============================================= --}} {{-- JavaScript --}} {{-- ============================================= --}}