Package Data | |
---|---|
Maintainer Username: | chaseconey |
Maintainer Contact: | chase.coney@gmail.com (Chase Coney) |
Package Create Date: | 2015-04-17 |
Package Last Update: | 2015-06-30 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-12-22 15:03:42 |
Package Statistics | |
---|---|
Total Downloads: | 86 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 7 |
Total Watchers: | 2 |
Total Forks: | 1 |
Total Open Issues: | 0 |
A very simple activity logger build specifically for laravel that tracks actions performed by users based on model events.
Inspired by a Laracasts Lesson
"require": {
"laravel/framework": "5.0.*",
"chaseconey/laravel-activity": "dev-master"
}
'Chaseconey\ActivityRecorder\ActivityProvider'
composer update
php artisan vendor:publish --provider="Chaseconey\ActivityRecorder\ActivityProvider" --tag="migrations"
php artisan migrate
use Chaseconey\ActivityRecorder\RecordsActivity;
Class Tweet extends Model
{
use RecordsActivity;
}
This package is supposed to be a sort of drop-in addition to your code base for tracking when a user is performing any model events you want. The information is stored in a table, activities, and an Activity model is also provided for accessing that information.
By default, created, updated, and deleted events are persisted to the table. You can change which events are processed by adding a static property to the model you have added the trait to:
Class Tweet extends Model
{
use RecordsActivity;
/**
* Which events to record for the auth'd user.
*
* @var array
*/
protected static $recordEvents = ['created'];
}