Hi guys. How to track users activity log? do you have some tutorials or article readings to recommend. thank you
Not sure if still relevant for you, but…
I came up with a solution by myself with a very easy logic. I created an ActivityHelper and ActivityComponent with a single function to push new activities to the database.
This is my table
- id (INT AUTO_INCREMENT PRIMARY) - user_id (INT) - activity (TEXT) - cta (TEXT) - parameters (TEXT) - created (DATETIME)
activity field i put the action i created (through my helper) and in the
cta field I added the link to the processed activity (as serialized array) and in
parameters additional parameters (also serialized array).
Example: I created a new user. After the
$this->Users->save() function in
Users/add I call the ActivityComponent and put in the data. The same thing is possible to create a new Activity in templates with the Helper.
Now I am implementing the activity log into my
bake templates, so I don’t have to add them manually.
Maybe I’ll create a new plugin for the new cake version…