API reference
Activity: Query and Display the Audit Log
Every logged change is stored as a Waypoint\Models\Activity. It is a normal Eloquent model, so you can query it like any other.
Attribute
Type
Description
eventstringName of the event, e.g.
updatedsubjectModelModel the activity belongs to
causer?ModelUser who made the change
changesCollectionOld and new values of the changed attributes
batch_id?stringGroups activities written by
Waypoint::batch()created_atCarbonTime of the change
Query scopes
php
use Waypoint\Models\Activity;
Activity::forSubject($invoice)
->causedBy($user)
->event('updated')
->between(now()->subWeek(), now())
->get();
Show the changes
changes contains the old and new value of every changed attribute. Loop over it to render a diff in Blade:
html
@foreach ($activity->changes as $attribute => $change)
<dt>{{ $attribute }}</dt>
<dd><del>{{ $change['old'] }}</del> <ins>{{ $change['new'] }}</ins></dd>
@endforeach
Last updated: