@foreach($header as $headerName => $headerTitle) @endforeach @foreach($strings as $string) @php $rowId = $string->id ?? null; $rowAnchor = $rowId ? 'row-' . $rowId : null; $rowHref = null; if (isset($routeName) && $rowId) { $rowHref = route($routeName, [$string->id, 'previous_url' => request()->fullUrl() . '#' . $rowAnchor]); } @endphp @foreach($header as $headerName => $headerTitle) @endforeach @endforeach
{{ $headerTitle }}
@if(($headerName== $sortBy)) @if($orderBy === 'asc') @else @endif @endif
@if($headerName !== 'image') @php $type = null; $data = (array_merge($filters, $ranges, $dates))[$headerName] ?? null; if (isset($filters[$headerName])) { $type = 'filters'; } elseif (isset($ranges[$headerName])) { // Для dropdown фильтров вместо диапазона используем список всех вариантов $type = 'filters'; } elseif (isset($dates[$headerName])) { $type = 'dates'; } @endphp @endif
@if(str_contains($headerName, '-')) @php list($rel, $field) = explode('-', $headerName); @endphp @if(isset($string->$rel->$field)) @if(str_ends_with($field, '_id')) @php $relation = \Illuminate\Support\Str::camel(str_replace('_id', '', $field)); @endphp {!! $string->$rel->$relation?->name; !!} @else @if(str_contains($field, 'image') && $string->$rel->$field) @else {!! $string->$rel->$field !!} @endif @endif @else
    @foreach($string->$rel ?? [] as $item)
  • {!! $item->$field !!}
  • @endforeach
@endif @elseif(str_ends_with($headerName, '_id')) @php $relation = \Illuminate\Support\Str::camel(str_replace('_id', '', $headerName)); @endphp @if($headerName == 'order_status_id')
{{ $string->$relation?->name }}
@else {!! $string->$relation?->name; !!} @endif @elseif(str_ends_with($headerName, '_date') && ($string->$headerName)) {{ \App\Helpers\DateHelper::getHumanDate($string->$headerName, true) }} @elseif(str_contains($headerName, 'image') && $string->$headerName) @elseif(str_contains($headerName, 'order_status_name')) @elseif($id === 'reclamations' && $headerName === 'status_name') @elseif($headerName === 'tsn_number' && $string->$headerName) {{ $string->$headerName }} @elseif($headerName === 'pricing_code' && $string->$headerName) {{ $string->$headerName }} @elseif($headerName === 'pricing_codes_list' && $string->pricingCodes->count() > 0) @foreach($string->pricingCodes as $pricingCode) {{ $pricingCode->code }} @if(!$loop->last)
@endif @endforeach @else

{!! \Illuminate\Support\Str::words($string->$headerName, config('app.words_in_table_cell_limit'), ' ...') !!}

@endif
@push('scripts') @endpush