@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 !== 'actions' && ($headerName== $sortBy)) @if($orderBy === 'asc') @else @endif @endif
@if(($enableColumnFilters ?? true) && $headerName !== 'image' && $headerName !== 'actions') @php $filters = $filters ?? []; $ranges = $ranges ?? []; $dates = $dates ?? []; $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 @elseif($id === 'pricing_codes' && $headerName === 'type') @if($string->type === 'tsn_number') № по ТСН @else Шифр расценки @endif @elseif($id === 'pricing_codes' && $headerName === 'description')
{{ $string->description }}
@elseif($id === 'pricing_codes' && $headerName === 'actions')
@csrf @method('DELETE')
@elseif($id === 'notifications' && $headerName === 'type') {{ $string->type_name }} @elseif($id === 'notifications' && $headerName === 'event') {{ $string->event_name }} @elseif($id === 'notifications' && $headerName === 'message') {!! $string->message_html ?: e($string->message) !!} @elseif($id === 'notifications' && $headerName === 'read_at') @if($string->read_at) {{ $string->read_at->format('d.m.Y H:i') }} @else @endif @elseif($id === 'notifications' && $headerName === 'created_at') {{ $string->created_at?->format('d.m.Y H:i') }} @elseif($headerName === 'actions' && isset($routeName) && isset($string->id)) Редактировать @else

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

@endif
@push('scripts') @endpush