bitfumes/laravel-activity-recorder

Your Package Description here

v0.1.2 2019-01-21 07:28 UTC

This package is auto-updated.

Last update: 2024-10-26 19:32:41 UTC


README

Install

composer require bitfumes/laravel-activity-recorder

Usage

This package record model events in activities table in your database.

Using Trait

use Illuminate\Database\Eloquent\Model;
use Bitfumes\Activity\Traits\RecordActivity;

class Item extends Model
{
    use RecordActivity;
}

Activity To Record

If you does't specify, then it will record only created model event.

Record other activities just need to specify a static variable in your model to track other model events also.

class Item extends Model
{
    use RecordActivity;

    protected static $eventsToRecord = ['created','deleted'];
}

Now this will also going to record deleted event of that model.

Testing

Run the tests with:

vendor/bin/phpunit

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security-related issues, please email sarthak@bitfumes.com instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.