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 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
propertiesJSON on a page any user can open until you have read what you stored.
The fix#
Spatie’s package is the one this search usually means:
composer require spatie/laravel-activitylog
php artisan vendor:publish --provider="Spatie\Activitylog\ActivitylogServiceProvider" --tag="activitylog-migrations"
php artisan migrateactivity()
->performedOn($post)
->causedBy($request->user())
->log('updated the post');Pass the latest rows to an admin page only:
'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#
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.
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.



