@foreach ($columns as $column) @if (!isset($column['can']) || auth()->user()->can($column['can'])) @endif @endforeach @if ($collection->isNotEmpty()) @foreach ($collection as $item) @foreach ($columns as $column) @if (!isset($column['can']) || auth()->user()->can($column['can'])) @endif @endforeach @endforeach @else @endif
S/N{{str_replace('_' , ' ', Str::snake( $column['name'] ?? $column['property']))}}
{{ $collection->perPage() * ($collection->currentPage() - 1) + $loop->iteration }} @php $model = $item; if (isset($column['relation'])) { $relations = explode('.',$column['relation']); foreach ($relations as $relation){ $model = $model->$relation; } } if (is_array($model)) { $model = collect($model); } @endphp

@if (array_key_exists('method', $column) && !empty($column['method'])) {{ ($model?->{$column['method']}()) }} @elseif (array_key_exists('type', $column) && !empty($column['type'])) @if ($column['type'] == 'delete')

Are you sure you want to {{Str::lower($column['name'])}} this resource

Continue with {{Str::lower($column['name'])}} @method('delete') @csrf
@elseif ($column['type'] == 'dropdown') @foreach ($column['links'] as $link) @if (!isset($link['can']) || auth()->user()->can($link['can'])) {{$link['text']}} @endif @endforeach @elseif($column['type'] == 'boolean-switch')
@csrf @elseif($column['type'] == 'image')
@endif @else @php $property = ($model?->{$column['property'] ?? $column['name']}) @endphp @if ($property instanceof \Carbon\Carbon) {{$property->format('Y/m/d')}} @elseif($property instanceof \Brick\Money\Money) {{$property->formatTo(app()->getLocale())}} @else {{$property}} @endif @endif

No data to Show
{{$collection->links()}}