Package Data | |
---|---|
Maintainer Username: | sarahman |
Package Create Date: | 2021-01-16 |
Package Last Update: | 2021-01-24 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2025-01-17 03:00:16 |
Package Statistics | |
---|---|
Total Downloads: | 234 |
Monthly Downloads: | 6 |
Daily Downloads: | 0 |
Total Stars: | 1 |
Total Watchers: | 2 |
Total Forks: | 0 |
Total Open Issues: | 1 |
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.
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 the composer
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!
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.
MIT
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!