{{--
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
| # | @foreach($columns as $col){{ ucwords(str_replace(['_', '.'], ' ', $col)) }} | @endforeachActions |
|---|---|---|
| {{ $item->id }} | @foreach($columns as $col)@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 | @endforeach{{-- Restore Button --}} {{-- Permanent Delete Button --}} |
Trash is empty.