S. Wasta
S. Wasta

Reputation: 638

Laravel: Is it possible to save all actions of users in logs or db?

I know you can save sessions actions of user in a file (logs) or database. But this file (or line in database) is rewrited in every action that user make, for example: If user start in login and then go to home, later go to about; this file is rewrite to from: home > to about. I know it is not the complete quote generated in log/db. Is it possible to storage the first action (from login to home) and the second (from home to about)? How can I do it? Thanks

Upvotes: 2

Views: 3465

Answers (3)

El Risitas
El Risitas

Reputation: 41

Laravel requests allow to get a lot of informations.

You can create a table in your database and a middleware which get the request anytime a route is called and store informations like the route called, the user id or even his referer in the table.

Check it out for more info about requests

Upvotes: 1

Jelly Bean
Jelly Bean

Reputation: 1219

I've been using Laravel Audits and it's pretty cool, give it a try.

It tracks pretty much everything you need, and shows you what was created and the old and new values when something is edited. but downfall is it does not track changes pivot tables

Check it out here: Laravel Audits

Upvotes: 4

Craig Ward
Craig Ward

Reputation: 2485

Maybe have a look at https://github.com/spatie/laravel-activitylog which allows you to specify your own logging requirements.

Upvotes: 2

Related Questions