EveryDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/HypathStack/model-scribe/llms.txt
Use this file to discover all available pages before exploring further.
LogEntry that ModelScribe writes to a driver carries a batchUuid — a UUID string that is persisted in the batch_uuid column of the log table. By default, each individual Eloquent event (a created, updated, or deleted call) produces its own LogEntry with a freshly generated UUID, so under normal automatic logging each entry is its own batch. The real power of batch_uuid emerges when you want to tie multiple related entries together so you can retrieve all the changes that happened as part of a single logical operation.
How batch_uuid Is Generated
The batch_uuid value is set inside the LogEntry constructor. If no UUID is provided, Str::uuid() is called automatically:
batch_uuid, even when you never think about batching. For automatic observer-driven logs, each event gets its own unique UUID. For manual logs created via ModelScribe::log(), the UUID is likewise generated per call — unless you take deliberate steps to share one across multiple calls (see below).
Querying Entries by Batch UUID
Becausebatch_uuid is a plain column on the ScribeLog model, you can query it like any other attribute using Eloquent:
Grouping Manual Logs with a Shared Batch UUID
The
LogEntry constructor accepts an optional ?string $batchUuid = null parameter. Since ModelScribe::log() creates a LogEntry internally, you can coordinate a shared batch UUID across multiple manual log calls by passing a consistent identifier via the properties array, or by building LogEntry objects directly if you are working at a lower level.properties of each related call so you can group and retrieve the entries together:
batch_id property:
Querying the Native batch_uuid Column
For automatic observer-driven entries, batch_uuid is always populated from the LogEntry value object. If you are building an integration that constructs LogEntry objects directly and passes them to a driver, you can supply a pre-generated UUID to group them:
batch_uuid in the database and can be fetched together: