@php $sectionType = $sectionType ?? request('section_type'); @endphp @forelse ($listresults as $index => $item) @php $route = '#'; $title = ''; if ($sectionType == 'comments') { $route = "$item->commentable_url#comment-$item->id"; $title = $item->content; } elseif (in_array($sectionType, ['news', 'posts', 'discussions'])) { $route = match ($sectionType) { 'news' => route('news.show', $item->id), 'posts' => route('posts.show', $item->id), 'discussions' => route('discussions.show', $item->id), default => '#', }; $title = $item->title; } $isItemSelected = false; if(isset($metadata['selectedSelectableItems'])) { $selection = $metadata['selectedSelectableItems']; if(isset($selection['all']) && $selection['all']) { if(isset($selection['unselectedItems']) && is_array($selection['unselectedItems'])) { $isItemSelected = !in_array($item->id, $selection['unselectedItems']); } else { $isItemSelected = true; } } elseif(isset($selection['selectedItems']) && is_array($selection['selectedItems']) ) { $isItemSelected = in_array($item->id, $selection['selectedItems']); } } @endphp
{{ $index + 1 }}
{{ $item->creator->name }}
{{ $item->creator->name }} {{-- @if ($item->creator->is_premium) {{ __('labels.premium') }} @endif --}}
{{ Str::limit($title, 30, '...') }}
@if ($sectionType == 'comments') @if ($item->commentable_url) {{ $item->commentable_name }} #{{ $item->commentable_id }} @else {{ $item->commentable_name }} #{{ $item->commentable_id }} @endif @endif
{{ optional($item->created_at)->format('d M Y') }}
{{ optional($item->created_at)->format('h:i A') }}
@empty

{{ __('datatable.no_matching_records_found') }}

@endforelse