|
{{ $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
@include('partials.newFilterElement', ['id' => $headerName, 'data' => $data, 'type' => $type, 'table' => $id, 'isSort' => $headerName == $sortBy, '$orderBy' => $orderBy])
@endif
|
@endforeach
|---|
@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)
{{ $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)
@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')
@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 |
@endforeach