| {{ $rows->firstItem() + $index }} |
{{-- @foreach ($columns as $column)
@if ($column == 'status')
{{ ucfirst($row->$column) }}
@else
{{ $row->$column }}
@endif
|
@endforeach --}}
{{-- @foreach ($columns as $column)
@if ($column == 'status')
@php
$status = match ($row->$column) {
1 => ['text' => 'Active', 'color' => 'success'],
0 => ['text' => 'Pending', 'color' => 'warning'],
2 => ['text' => 'Blocked', 'color' => 'danger'],
default => ['text' => 'Unknown', 'color' => 'secondary'],
};
@endphp
{{ $status['text'] }}
@else
{{ data_get($row, $column) }}
@endif
|
@endforeach --}}
@foreach ($columns as $column)
@if ($column == 'thumbnail')
@if ($row->thumbnail)
@else
No Image
@endif
{{-- @elseif ($column == 'status')
@php
$status = match ($row->$column) {
1 => ['text' => 'Active', 'color' => 'success'],
0 => ['text' => 'Pending', 'color' => 'warning'],
2 => ['text' => 'Blocked', 'color' => 'danger'],
default => ['text' => 'Unknown', 'color' => 'secondary'],
};
@endphp
{{ $status['text'] }}
--}}
@elseif ($column == 'status')
@php
$status = match ((int) $row->$column) {
1 => [
'text' => 'Active',
'color' => 'success',
],
0 => [
'text' =>
isset($statusType) && $statusType == 'pending'
? 'Pending'
: 'Inactive',
'color' =>
isset($statusType) && $statusType == 'pending'
? 'warning'
: 'danger',
],
2 => [
'text' => 'Blocked',
'color' => 'danger',
],
default => [
'text' => 'Unknown',
'color' => 'secondary',
],
};
@endphp
{{ $status['text'] }}
@else
{{ data_get($row, $column) }}
@endif
|
@endforeach
@if (count($actions))
@foreach ($actions as $action => $enabled)
@if ($enabled)
@switch($action)
@case('view')
@break
@case('edit')
@break
@case('delete')
@break
@endswitch
@endif
@endforeach
|
@endif
@empty