Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Maelfjord's avatar

Logging User Activity in the Database

There are obviously a number of ways to store user activity in the database.

While researching, I came up on a number of options such as: using user-made packages, creating events and listeners, making custom services, and even just manually creating rows on the logs table.

My question is: at least in the Laravel community, what is the most common or accepted way of logging user activity in the database? Thanks in advance!

0 likes
6 replies
Maelfjord's avatar

@Tray2 Thank you for the reply! I am aware of this option, by I'm looking for a method where I have a logs table (for example, user_logs) and I can log any activity in the system by the user, not just database changes (like logging-in).

amitsolanki24_'s avatar

https://github.com/spatie/laravel-activitylog Please check this package may be it will helpful.

Maelfjord's avatar

@amitsolanki24_ This looks like a great package. But I'm still in the lookout for a solution using only vanilla Laravel.

martinbean's avatar

@maelfjord What you’re describing is auditing. There’s many packages out there that will provide this if you search for “laravel auditing package” in Google or similar.

Please or to participate in this conversation.