@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
| @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->client)
@php
$firstInitial = strtoupper(substr($option->client->firstname ?? '', 0, 1));
$lastInitial = strtoupper(substr($option->client->lastname ?? '', 0, 1));
$initials = $firstInitial . $lastInitial;
@endphp
@if($initials)
{{ $initials }}
@endif
{{ $option->client->fullName() }}
@else
Client inconnu
@endif
|
@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 |