@php $sortUrl = function($col, $defaultDir = 'asc') use ($sortBy, $sortDir) { $isCurrentCol = ($sortBy ?? '') === $col; $currentDir = $sortDir ?? $defaultDir; $newDir = $isCurrentCol && $currentDir === $defaultDir ? ($defaultDir === 'asc' ? 'desc' : 'asc') : $defaultDir; $query = array_merge( request()->except('options_sort_by', 'options_sort_dir'), ['options_sort_by' => $col, 'options_sort_dir' => $newDir, 'tab' => 'options'] ); return url()->current().'?'.http_build_query($query); }; @endphp
@foreach($options as $option) @endforeach
@if(($sortBy ?? '') === 'client') @else @endif Client @if(($sortBy ?? '') === 'rank') @else @endif Rang @if(($sortBy ?? 'created_at') === 'created_at') @else @endif Posée le @if(($sortBy ?? '') === 'date_end') @else @endif Fin @if(($sortBy ?? '') === 'state') @else @endif Statut
@if($option->getRang()) Rang {{ $option->getRang() }} @else - @endif @if($option->created_at) {{ $option->created_at->format('d/m/Y à H:i') }} @else - @endif @if($option->date_end) {{ $option->date_end->format('d/m/Y à H:i') }} @else - @endif @if($option->state) {{ $option->state->label() }} @endif