New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

vluzrmos/simple-revisions

An Eloquent simple revisions package.
36
Install
composer require vluzrmos/simple-revisions
Latest Version:v0.0.2
Laravel:5
License:MIT
Last Updated:Jan 4, 2016
Links: GitHub  ·  Packagist
Maintainer: vluzrmos

Simple Revisions

Latest Stable Version Total Downloads Latest Unstable Version License

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

yadakhov/insert-on-duplicate-key

A trait for MySQL INSERT ON DUPLICATE KEY UPDATE.

3,123,272 275
audunru/eager-load-pivot-relations

Eager load pivot relations for Laravel Eloquent's BelongsToMany relation.

76,692 9
someonefamous/laravel-findby

Extended 'find' functionality for Eloquent (Laravel).

11,659 3
vluzrmos/eloquent-simple-searchable

An Eloquent Simple Searchable Scope.

212 2
hpolthof/laravel-eloquent-settings

Allow for dynamic blobbed settings in Eloquent models.

52 1

Version History

Version Released Laravel License
v0.0.2 ~5.0 MIT
v0.0.1 ~5.0 MIT