@push('style')
@endpush
@php
$headers = [
// EXTRA DATA HIDDEN
[
'label' => '',
'target' => 'all_products',
'hclass' => 'hidden',
'dclass' => 'hidden'
],
[
'label' => '',
'target' => 'all_stores',
'hclass' => 'hidden',
'dclass' => 'hidden'
],
[
'label' => '',
'target' => 'label',
'hclass' => 'hidden',
'dclass' => 'hidden'
],
// VISIBLE DATA HIDDEN
[
'label' => __('table.header.id'),
'target' => 'id',
],
[
'label' => __('table.header.code'),
'target' => 'code',
],
[
'label' => __('table.header.name'),
'target' => 'name',
'dclass' => 'lefted',
],
[
'label' => __('table.header.rate'),
'target' => 'rate',
'hclass' => 'tax',
],
[
'label' => __('table.header.products'),
'target' => 'products_count',
],
[
'label' => __('table.header.stores'),
'target' => 'stores_count',
],
[
'label' => __('table.header.created'),
'target' => 'created_at',
],
[
'label' => __('table.header.description'),
'target' => 'description',
'wclass' => 'description',
'hclass' => 'description',
'dclass' => 'description',
]
];
// GET HEADERS TARGETS
$col = array_flip( array_column($headers, 'target') );
@endphp
@include('components.table', [
'id' => $id,
'edit' => @$edit, // EDIT TARGET ID
'class' => 'table cell-border hover',
'data' => $data,
'headers' => $headers,
'fields' => $col, // TRACK COLUMNS BY NAME
])
@push('ready')
@endpush