@push('style')
@endpush
@php
// TABLE HEADERS
# SEPARATED TO HANDLE CONFIG CONSTRUCTION IN THIS FILE
$headers = [
// EXTRA DATA HIDDEN
[
'label' => '',
'target' => 'category_label',
'hclass' => 'hidden',
'dclass' => 'hidden'
],
[
'label' => __('table.header.id'),
'target' => 'category_id',
'hclass' => 'hidden',
'dclass' => 'hidden'
],
// VISIBLE DATA
[
'label' => __('table.header.id'),
'target' => 'id',
],
[
'label' => __('table.header.code'),
'target' => 'code',
],
[
'label' => __('table.header.category'),
'target' => 'category_code',
'dclass' => 'lefted',
],
[
'label' => __('table.header.name'),
'target' => 'name',
'dclass' => 'lefted',
],
[
'label' => __('table.header.price'),
'target' => 'price'
],
[
'label' => __('table.header.orders'),
'target' => 'orders_count',
],
[
'label' => __('table.header.stock'),
'target' => 'stock',
],
[
'label' => __('table.header.registered'),
'target' => 'created_at',
],
[
'label' => __('table.header.description'),
'target' => 'description',
'wclass' => 'description',
'hclass' => 'description',
'dclass' => 'description',
],
[
'label' => __('table.header.notes'),
'target' => 'notes',
'hclass' => 'notes',
'wclass' => 'notes'
],
[
'label' => __('table.header.images'),
'hclass' => 'handle',
'target' => '_button',
'class' => 'btn btn-info images',
'icon' => 'fa fa-file-image-o'
],
[
'label' => __('table.header.documents'),
'hclass' => 'handle',
'target' => '_button',
'class' => 'btn btn-primary documents',
'icon' => 'fa fa-file-text-o'
],
[
'label' => __('table.header.edit'),
'target' => '_edit',
],
[
'label' => __('table.header.delete'),
'target' => '_delete'
],
];
// 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
])
@push('ready')
@endpush