@php
$id = 'orderDocuments';
if(!isset($order_id)) $order_id = 0;
$headers = [
[
'label' => 'URL',
'hclass' => 'hidden',
'dclass' => 'hidden',
'target' => 'url',
],
[
'label' => __('table.header.id'),
'target' => 'id',
],
[
'label' => __('table.header.file'),
'hclass' => 'media-filename',
'dclass' => 'lefted',
'target' => 'name',
],
[
'label' => __('table.header.path'),
'hclass' => 'media-path',
'target' => 'path',
],
[
'label' => __('table.header.type'),
'target' => 'type',
'dclass' => 'lefted',
],
[
'label' => __('table.header.size'),
'target' => 'size.readable',
],
[
'label' => __('table.header.uploaded'),
'target' => 'uploaded',
],
[
'label' => __('table.header.preview'),
'class' => 'btn btn-primary preview',
'hclass' => 'handle',
'icon' => 'fa fa-eye',
'target' => '_button'
],
[
'label' => __('table.header.download'),
'class' => 'btn btn-success download',
'hclass' => 'handle',
'icon' => 'fa fa-download',
'target' => '_button'
],
[
'label' => __('table.header.delete'),
'target' => '_delete'
]
];
// GET HEADERS TARGETS
$col = array_flip( array_column($headers, 'target') );
@endphp
@include('components.media', [
'id' => $id, // INPUT ID BIND
'tabs' => [
'active' => 'all_docs',
'records' => [
'id' => 'all_docs',
'title' => __('label.media.files')
],
'upload' => [
'id' => 'add_docs',
'title' => __('label.media.add-files')
],
],
'config' => @$config,
'through' => empty($config) ? "{$order_id}/documents" : true,
'target' => @$route ?? 'order.documents.store',
'resource' => 'orders',
'headers' => $headers,
'records' => empty($config) ? $records : [],
])
{{-- TRACK IF REQUEST FROM SERVICE--}}
@if(@$config)
@push('style')
@endpush
@push('ready')
@endpush
@endif