@extends('admin.layout') @section('title', 'Pesanan ' . $order->code) @section('subtitle', $order->title) @php $orderMeta = [ 'searching' => ['Mencari', 'amber'], 'accepted' => ['Diterima', 'blue'], 'on_the_way' => ['Menuju lokasi', 'blue'], 'in_progress' => ['Dikerjakan', 'blue'], 'completed' => ['Selesai', 'green'], 'cancelled' => ['Dibatalkan', 'red'], 'rejected' => ['Ditolak', 'red'], ]; [$stLbl, $stTone] = $orderMeta[$order->status->value ?? $order->status] ?? ['—','gray']; @endphp @section('content') ‹ Kembali ke daftar pesanan
{{ $order->code }}

{{ $order->title ?? $order->category?->name }}

{{ $order->category?->name }}
{{ $stLbl }}
@if ($order->description)

{{ $order->description }}

@endif
Dibuat
{{ $order->created_at?->format('d M Y, H:i') }}
Diterima
{{ $order->accepted_at?->format('d M Y, H:i') ?? '—' }}
Selesai
{{ $order->completed_at?->format('d M Y, H:i') ?? '—' }}
Dibatalkan
{{ $order->cancelled_at?->format('d M Y, H:i') ?? '—' }}
Alamat
{{ $order->address_snapshot ?? $order->address?->detail ?? '—' }}
@if ($order->lat)
{{ $order->lat }}, {{ $order->lng }}
@endif
@if ($order->review)

Ulasan

{{ str_repeat('★', $order->review->rating) }}{{ str_repeat('★', 5 - $order->review->rating) }}
@if ($order->review->body)

{{ $order->review->body }}

@endif @if (!empty($order->review->tags))
@foreach ($order->review->tags as $tag){{ $tag }}@endforeach
@endif
@endif @if ($conversation)

Percakapan

Buka ›
@foreach ($conversation->messages->take(30) as $msg) @php $fromCustomer = $msg->sender_id === $order->customer_id; @endphp
{{ $msg->sender?->name }}
{{ $msg->body }}
@endforeach
@endif

Customer

@if ($order->customer)
{{ $order->customer->initials() }}
{{ $order->customer->name }}
{{ $order->customer->phone }}
@else

@endif

Mitra

@if ($order->mitra)
{{ $order->mitra->initials() }}
{{ $order->mitra->name }}
{{ $order->mitra->phone }}
@if ($order->mitra->mitraProfile) Lihat profil mitra › @endif @else

Belum ada mitra.

@endif
@endsection