Β© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filamentβ€’3y agoβ€’
4 replies
Aditya Khadka | Nepal

Displaying 'New' and 'Old' Changes from Spatie Activity Log in an InfoList

Hello everyone! πŸ‘‹

I'm using the Spatie Activity Log package in my Laravel project to track model changes. The package logs the 'new' and 'old' values of the changed attributes in the
properties
properties
field, and this data is stored as a collection.

I'm facing an issue with displaying these values in a user-friendly way in my InfoList component. I want to compare the 'old' and 'new' values side by side.

Here's what I have so far:

- I've set up the Activity Log, and it's working fine; changes are being logged correctly.
- I can access the
properties
properties
field in my activity log model, which gives me a collection containing 'new' and 'old' values.

properties= ({"attributes":{"title":"Pizza cheese sticks","price":4.5,"dine_in_price":0},"old":{"title":"Pizza cheese stick","price":4.5,"dine_in_price":0}})

My question is: How can I efficiently parse and display this data in an InfoList? I'm looking for a way to iterate over the 'attributes' and 'old' arrays within the
properties
properties
collection and present them in a tabular or side-by-side format for easy comparison.

Any suggestions or examples of how you've tackled a similar situation would be greatly appreciated!

Thank you in advance!
Solution
I found solution myself it was really simple

KeyValueEntry::make('properties.attributes')
->label('New Value')
->columnSpan(2),
KeyValueEntry::make('properties.old')
->label('Old Value')
->visible(fn (Activity $record) => $record->properties->has('old'))
->columnSpan(2),
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel β€’ Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

How to Spatie Activity Log Customize?
FilamentFFilament / β“β”Šhelp
3y ago
Displaying an array of images in Infolist.
FilamentFFilament / β“β”Šhelp
4mo ago
Filament Activity Logger to show old and new values
FilamentFFilament / β“β”Šhelp
3y ago
Spatie media library infolist DocumentEntry
FilamentFFilament / β“β”Šhelp
2y ago