# Show an activity log on a Vue page

> Log the subject and the user from the controller. Pass the latest rows as a prop. Do not log a password.

- URL: https://laravel-vuejs.space/laravel-activity-log-vue
- Author: Anass Ez-zouaine (https://laravel-vuejs.space/author/anass-ez-zouaine)
- Published: 2026-10-11
- Topics: Laravel, VueJs

People searching “Laravel activity log Vue” install a package and then log `$request->all()`. That stores the password. Log a sentence and the subject. The [policy guide](https://laravel-vuejs.space/laravel-vue-policies) is who may open the page that lists those rows.

> **TL;DR**
>
> -   Log the subject and the user from the controller.
> -   Pass the latest rows as a prop.
> -   Do not log a password.
> -   Do not put the `properties` JSON on a page any user can open until you have read what you stored.
>
> **Who it's for:** Laravel + Vue developers
>
> **Applies to:** Laravel 13 · Vue 3

## The fix

Spatie’s package is the one this search usually means:

```shell
composer require spatie/laravel-activitylog
php artisan vendor:publish --provider="Spatie\Activitylog\ActivitylogServiceProvider" --tag="activitylog-migrations"
php artisan migrate
```

```php
activity()
    ->performedOn($post)
    ->causedBy($request->user())
    ->log('updated the post');
```

Pass the latest rows to an admin page only:

```php
'activity' => Activity::query()->latest('id')->limit(20)->get(['id', 'description', 'created_at']),
```

## What to avoid

> **Gotcha**
>
> Do not put the `properties` JSON on a page any user can open until you have read what you stored. Do not log attribute changes on `User` without an except list. Tokens and passwords do not belong in `activity_log`.

## FAQ

**Q: How do I show an activity log on a Vue page?**

Log the subject and the user from the controller. Pass the latest rows as a prop. Do not log a password.

**Q: What goes wrong with Laravel activity log Vue?**

Many developers install a package and then log `$request->all()`. Do not put the `properties` JSON on a page any user can open until you have read what you stored.
