In the digital era, tracking and recording user activity has become essential. Whether for security compliance, behavioural analysis or operational efficiency, a robust and efficient activity log system is key. In this article we outline how we implemented this functionality in several projects using two powerful stacks:

  • Laravel + Vue.js
  • Laravel + Livewire

Kit Digital (Spanish Digitalisation Grant)

The Kit Digital is a Spanish government initiative that subsidises SMEs and self‑employed professionals adopting digital solutions. As an authorised digitalising agent we’ve built modules that help beneficiaries improve internal processes.

The Process management category informed this requirement. Tracking user actions lets us understand and optimise workflows, detect bottlenecks and improve UX. With Laravel plus the capabilities of Vue.js and Livewire we built an activity logging system matching both grant requirements and client expectations.

Development

Backend

We begin on the backend: we needed to log user actions across different Kit Digital projects.

Our backend framework of choice is Laravel. For this we rely on a powerful open‑source package: laravel-activitylog by Spatie.

It lets us record any user action and provides convenient APIs:

Activity logging helper

activity($name)
   ->performedOn($anEloquentModel)
   ->causedBy($user)
   ->withProperties(['customProperty' => 'customValue'])
   ->log('Look mum, I logged something');

We can attach a model, a user, custom properties— whatever context we need.

Trait

To automatically log all changes related to a model we add the LogsActivity trait and define:

public function getActivitylogOptions(): LogOptions
{
    return LogOptions::defaults()->logFillable();
}

Frontend

Authorised users must visualise activity. Both Vue.js and Livewire offer rich component ecosystems to build an intuitive UI. Below is a Livewire table mock: it lists access events, filters by activity type, date or free search.

access logs table

Conclusions

Implementing user activity logging has been crucial for process optimisation and Kit Digital compliance. Combining Laravel + Vue.js or Laravel + Livewire yields an efficient, flexible and maintainable solution. Choosing between them depends on project context and team preference.

Need a tailored proposal? Contact us and we’ll analyse your case.