vluzrmos/simple-revisions
Simple Revisions
That package listen for events in yours eloquent models and store the data that is saving/updating/creating.
Installation
composer require vluzrmos/simple-revisions
put that service provider in your config/app.php file:
Vluzrmos\SimpleRevisions\Providers\SimpleRevisionsServiceProvider::class
Run the artisan command to add the package migrations to your database migrations path:
php artisan vendor:publish --provider=Vluzrmos\SimpleRevisions\Providers\SimpleRevisionsServiceProvider
And then run your migrations:
php artisan migrate
Note: Be sure that exists an users table (that table name is in your
config/auth.php).
Usage
The model you want to log revisions should be like that:
use Illuminate\Database\Eloquent\Model;
use Vluzrmos\SimpleRevisions\Contracts\Revisionable;
use Vluzrmos\SimpleRevisions\Eloquent\RevisionableTrait;
class MyModel extends Model implements Revisionable
{
use RevisionableTrait;
}
And then, when you save, update or delete an instance of your model, it should be revisioned!
Related Packages
ablunier/laravel-database
Laravel database utilities package. Repository, cache, abstraction layer.
4,438
1
czim/laravel-repository
Repository for Laravel (inspired by and indebted to Bosnadev/Repositories)
114,134
52
czim/laravel-filter
Filter for Laravel Eloquent queries, with support for modular filter building
75,970
89