https://github.com/bitfumes/laravel-activity-recorder
It records laravel model events in activity table
https://github.com/bitfumes/laravel-activity-recorder
Last synced: about 2 months ago
JSON representation
It records laravel model events in activity table
- Host: GitHub
- URL: https://github.com/bitfumes/laravel-activity-recorder
- Owner: bitfumes
- License: mit
- Created: 2019-01-07T15:57:07.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-26T08:11:38.000Z (over 5 years ago)
- Last Synced: 2024-08-09T18:15:54.039Z (10 months ago)
- Language: PHP
- Size: 13.7 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Activity Recorder
## Install
`composer require bitfumes/laravel-activity-recorder`
## Usage
This package record model events in activities table in your database.
### Using Trait
```php
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.```php
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:
```bash
vendor/bin/phpunit
```## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
## Security
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
## License
The MIT License (MIT). Please see [License File](/LICENSE.md) for more information.