optimized list

pull/44/head
A1Gard 6 months ago
parent b634056dd1
commit 1082906bf5

@ -174,45 +174,46 @@
@else @else
<td> <td>
@switch($col) @switch($col)
@case($col == 'parent_id') @case('parent_id')
{{ $item->parent?->{$cols[0]}??'-' }} {{ $item->parent?->{$cols[0]}??'-' }}
@break @break
@case($col == 'status') @case('status')
<div class="model-status status-{{$item->status}} float-start"></div> <div class="model-status status-{{$item->status}} float-start"></div>
@break @break
@case($col == 'user_id') @case('user_id')
<a href="{{route('admin.user.edit',$item->user?->email)}}"> <a href="{{route('admin.user.edit',$item->user?->email)}}">
{{ $item->user?->name??'-' }} {{ $item->user?->name??'-' }}
</a> </a>
@break @break
@case($col == 'customer_id') @case('customer_id')
<a href="{{route('admin.customer.edit',$item->customer?->id)}}"> <a href="{{route('admin.customer.edit',$item->customer?->id)}}">
{{ $item->customer?->name??'-' }} {{ $item->customer?->name??'-' }}
</a> </a>
@break @break
@case($col == 'category_id') @case('category_id')
<a href="{{route('admin.category.edit',$item->category?->slug)}}"> <a href="{{route('admin.category.edit',$item->category?->slug)}}">
{{ $item->category?->name??'-' }} {{ $item->category?->name??'-' }}
</a> </a>
@break @break
@case($col == 'product_id') @case('product_id')
<a href="{{route('admin.product.edit',$item->product?->slug)}}"> <a href="{{route('admin.product.edit',$item->product?->slug)}}">
{{ $item->product?->name??'-' }} {{ $item->product?->name??'-' }}
</a> </a>
@break @break
@case($col == 'expire') @case('expire')
{{$item->expire->ldate("Y-m-d")}} @case('created_at')
@case('updated_at')
{{$item->$col->ldate("Y-m-d H:i")}}
@break @break
@case($col == 'icon') @case('icon')
<i class="{{$item->$col}}"></i> <i class="{{$item->$col}}"></i>
@break @break
@case(substr($col,0,3) == 'is_') @default
@if(substr($col,0,3) == 'is_')
@if($item->$col == 1) @if($item->$col == 1)
<i class="ri-check-line"></i> <i class="ri-check-line"></i>
@endif @endif
@break @elseif(gettype($item->$col) == 'integer')
@default
@if(gettype($item->$col) == 'integer')
{{number_format($item->$col)}} {{number_format($item->$col)}}
@else @else
{{$item->$col}} {{$item->$col}}

Loading…
Cancel
Save