{{-- The History tab's timeline — docs/wireframes-v12/edit-booking.html (~lines 374-386). @include('bookings.partials.history', ['history' => $history]) Shared by the edit and the show screens for the reason the documents partial records: this is a read, identical on both, and not a form field the twin rule governs. ## What it is, and what it deliberately is not (assumption A2) A **plain rendering of the activity-log rows** HasAudit already writes for the booking — nothing composes a narrative from the changed attributes, and the wireframe's "Co-applicant Sonal Patel added" line has no equivalent because customers are their own subject and their entries are not on this booking. Inventing that join would be inventing a requirement. The sentence is composed here rather than in the controller because it is *wording*, and this module keeps its wording where it is shown (CR-8 §0.1 — no lang file). The controller hands over three facts per row: the formatted time, the log's event name, and the causer's name when there was one. `$entry['event']` comes from spatie's `event` column. Three of the six names below are written by the library from the model event that fired; the other three are written **explicitly** by BookingService, because HasAudit's `logFillable()` cannot see the columns they are about — the cancellation columns are server-owned and outside `$fillable` (CR-9's corrected decision D15), and `documents_deleted` is not about this model's columns at all but about rows of another table that a type change swept away (CR-15.2 item G3). Without those three, a cancellation and a document sweep would leave no row here at all. Any value outside the six degrades to the raw word rather than to a blank line. It is escaped like everything else here. --}} @php /** @var list $history */ @endphp @if ($history === [])

Nothing has been recorded against this booking yet.

@else
@foreach ($history as $entry) @php $sentence = match ($entry['event']) { 'created' => 'Booking created', 'updated' => 'Booking updated', 'deleted' => 'Booking deleted', // The three BookingService writes by hand (CR-9 D15; // CR-15.2 G3). 'cancelled' => 'Booking cancelled', 'cancellation_updated' => 'Cancellation updated', 'documents_deleted' => 'Documents removed after a Booking Entity Type change', default => ucfirst(str_replace('_', ' ', $entry['event'])), }; @endphp
{{ $entry['time'] }}
{{ $sentence }}@if ($entry['causer'] !== null) by {{ $entry['causer'] }}@endif
@endforeach
@endif