sarahman / laravel-activitylog-with-pivots
Activity Log package deals with all kinds of Eloquent events based logging as well as pivot models events.
Requires
- php: ^7.0
- fico7489/laravel-pivot: >=3.0
- spatie/laravel-activitylog: >=2.0
Requires (Dev)
- phpunit/phpunit: ^6.0
This package is auto-updated.
Last update: 2024-11-30 02:16:25 UTC
README
This package highly depends on the spatie/laravel-activitylog
and fico7489/laravel-pivot
composer packages. This package deals with all kinds of Eloquent
events based logging as well as the Pivot
models events.
Installation
- Install package with composer:
composer require sarahman/laravel-activitylog-with-pivots
With this statement, the highest available package version for your current laravel/lumen version will be installed.
-
Follow the documentation of the
spatie/laravel-activitylog
to install with skipping thecomposer
package installation command. -
Use
Sarahman\Database\Support\Traits\LogsActivityWithPivots
trait in your base model or only in particular models.
use Sarahman\Database\Support\Traits\LogsActivityWithPivots; use Illuminate\Database\Eloquent\Model; abstract class BaseModel extends Model { use LogsActivityWithPivots; ... ... }
and that's it; enjoy!
New Eloquent Events
You can check all the Eloquent events here: (https://laravel.com/docs/master/eloquent#events)
The following Pivot based events functionality is customized:
pivotAttached, pivotDetached, pivotUpdated
The activity log is also stored while these pivot events will be occurred. You may check the other Pivot events here.
Licence
MIT
Support
If you are having general issues with this package, feel free to contact me through Gmail.
If you believe you have found an issue, please report it using the GitHub issue tracker, or better yet, fork the repository and submit a pull request.
If you're using this package, I'd love to hear your thoughts. Thanks!