@include('orders._tabs')
@if (session('status'))
{{ session('status') }}
@endif
@php
$th = function ($col, $label) use ($sort, $dir) {
$next = ($sort === $col && $dir === 'asc') ? 'desc' : 'asc';
$arrow = $sort === $col ? ($dir === 'asc' ? ' ↑' : ' ↓') : '';
$url = request()->fullUrlWithQuery(['sort' => $col, 'dir' => $next, 'page' => null]);
return new \Illuminate\Support\HtmlString('
'.e($label).$arrow.'');
};
@endphp
| {{ $th('client', 'Client') }} |
{{ $th('title', 'Order') }} |
{{ $th('quantity', 'Quantity') }} |
{{ $th('handover_date', 'Handover date') }} |
{{ $th('status', 'Status') }} |
@forelse ($orders as $order)
@php
$seen = $views[$order->id] ?? null;
$changed = $order->last_other_change && (! $seen || \Illuminate\Support\Carbon::parse($order->last_other_change)->gt($seen));
@endphp
|
{{ $order->client }}
@if ($changed)
New changes
@endif
|
{{ $order->title }} |
{{ number_format($order->quantity) }} |
{{ $order->handover_date->format('d.m.Y') }} |
@include('orders._status', ['status' => $order->status]) |
@empty
| No orders found. |
@endforelse
{{ $orders->links() }}