2017 © Pedro Peláez
 

library revisionable

Nice and easy way to handle revisions of your MongoDB.

image

dataworkstr/revisionable

Nice and easy way to handle revisions of your MongoDB.

  • Wednesday, November 16, 2016
  • by enginkartal
  • Repository
  • 1 Watchers
  • 1 Stars
  • 72 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 42 Forks
  • 0 Open issues
  • 40 Versions
  • 0 % Grown

The README.md

dataworkstr/Revisionable

Nice and easy way to handle revisions of your MongoDB., (*1)

*Lumen5 + MongoDB revisions *Support Document Model, (*2)

Requirements

  • This package requires PHP 5.4+
  • MongoDB 3.0+
  • Currently it works out of the box with Laravel5 + generic Illuminate Guard, tymon/jwt-auth OR cartalyst/sentry 2/sentinel 2

Usage (Laravel5 basic example - see Customization below as well)

1. Download the package or require in your composer.json:

    "require": {

        // for Lumen5+ use:
        "dataworkstr/revisionable": "~1.0",
        ...
    },

2. Add the service provider to your app/config/app.php:

    'providers' => array(

        ...

        'Sofa\Revisionable\Laravel\ServiceProvider',
    ),

3. Publish the package config file:

~$ php artisan vendor:publish [--provider="Sofa\Revisionable\Laravel\ServiceProvider"]

this will create config/sofa_revisionable.php file, where you can adjust a few settings:, (*3)

<?php

return [

    /*
    |--------------------------------------------------------------------------
    | User provider (auth) implementation.
    |--------------------------------------------------------------------------
    |
    | By default Laravel generic Illuminate\Auth\Guard.
    |
    | Supported options:
    |  - illuminate
    |  - sentry
    |  - sentinel
    |  - jwt-auth
    */
    'userprovider' => 'illuminate',


    /*
    |--------------------------------------------------------------------------
    | User field to be saved as the author of tracked action.
    |--------------------------------------------------------------------------
    |
    | By default:
    |
    |  - id for illuminate
    |  - login field (email) for sentry/sentinel
    |  - id or ANY field in User model for tymon/jwt-auth
    */
    'userfield'    => null,


    /*
    |--------------------------------------------------------------------------
    | Table used for the revisions.
    |--------------------------------------------------------------------------
    */
    'table'        => 'revisions',

         /*
     |--------------------------------------------------------------------------
     | Table max revision count / default=10
     |--------------------------------------------------------------------------
     */
      'options'        => [
          'max_revision'=>10
      ],   

];

4. Run the migration in order to create the revisions table:

~$ php artisan migrate [--database=custom_connection]

You can provide additional --database param if you want the migration to be run using non-default db connection., (*4)

5. Add revisionable trait and contract to the models you wish to keep track of:

<?php namespace App;

use Sofa\Revisionable\Laravel\RevisionableTrait; // trait
use Sofa\Revisionable\Revisionable; // interface

class User extends \Eloquent implements Revisionable {

    use RevisionableTrait;

    /*
     * Set revisionable whitelist - only changes to any
     * of these fields will be tracked during updates.
     */
    protected $revisionable = [
        'email',
        'name',
        'phonenumber.main_phone.0'
    ];

The Versions

16/11 2016

5.3.x-dev

5.3.9999999.9999999-dev

Nice and easy way to handle revisions of your MongoDB.

  Sources   Download

MIT

The Requires

 

The Development Requires

mongodb laravel lumen eloquent revision history document revisionable

16/11 2016

v5.3.9

5.3.9.0

Nice and easy way to handle revisions of your MongoDB.

  Sources   Download

MIT

The Requires

 

The Development Requires

mongodb laravel lumen eloquent revision history document revisionable

17/10 2016

v5.3.8

5.3.8.0

Nice and easy way to handle revisions of your MongoDB.

  Sources   Download

MIT

The Requires

 

The Development Requires

mongodb laravel lumen eloquent revision history document revisionable

03/10 2016

v5.3.7

5.3.7.0

Nice and easy way to handle revisions of your MongoDB.

  Sources   Download

MIT

The Requires

 

The Development Requires

mongodb laravel lumen eloquent revision history document revisionable

03/10 2016

v5.3.6

5.3.6.0

Nice and easy way to handle revisions of your MongoDB.

  Sources   Download

MIT

The Requires

 

The Development Requires

mongodb laravel lumen eloquent revision history document revisionable

06/09 2016

v5.3.5

5.3.5.0

Nice and easy way to handle revisions of your MongoDB.

  Sources   Download

MIT

The Requires

 

The Development Requires

mongodb laravel lumen eloquent revision history document revisionable

06/09 2016

v5.3.4

5.3.4.0

Nice and easy way to handle revisions of your MongoDB.

  Sources   Download

MIT

The Requires

 

The Development Requires

mongodb laravel lumen eloquent revision history document revisionable

29/08 2016

v5.3.3

5.3.3.0

Nice and easy way to handle revisions of your MongoDB.

  Sources   Download

MIT

The Requires

 

The Development Requires

mongodb laravel lumen eloquent revision history document revisionable

25/08 2016

v5.3.2

5.3.2.0

Nice and easy way to handle revisions of your MongoDB.

  Sources   Download

MIT

The Requires

 

The Development Requires

mongodb laravel lumen eloquent revision history document revisionable

23/08 2016

v5.3.1

5.3.1.0

Nice and easy way to handle revisions of your MongoDB.

  Sources   Download

MIT

The Requires

 

The Development Requires

mongodb laravel lumen eloquent revision history document revisionable

22/08 2016

5.2.x-dev

5.2.9999999.9999999-dev

Nice and easy way to handle revisions of your MongoDB.

  Sources   Download

MIT

The Requires

 

The Development Requires

mongodb laravel lumen eloquent revision history document revisionable

22/08 2016

v5.3

5.3.0.0

Nice and easy way to handle revisions of your MongoDB.

  Sources   Download

MIT

The Requires

 

The Development Requires

mongodb laravel lumen eloquent revision history document revisionable

29/07 2016

v2.0.4

2.0.4.0

Nice and easy way to handle revisions of your db.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel eloquent revision history revisionable

29/07 2016

v2.0.3

2.0.3.0

Nice and easy way to handle revisions of your db.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel eloquent revision history revisionable

29/07 2016

v2.0.2

2.0.2.0

Nice and easy way to handle revisions of your db.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel eloquent revision history revisionable

29/07 2016

v2.0.1

2.0.1.0

Nice and easy way to handle revisions of your db.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel eloquent revision history revisionable

26/07 2016

v2.0

2.0.0.0

Nice and easy way to handle revisions of your db.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel eloquent revision history revisionable

14/04 2016

v5.2.1

5.2.1.0

Nice and easy way to handle revisions of your db.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

laravel eloquent revision history revisionable

14/04 2016

5.2

5.2.0.0

Nice and easy way to handle revisions of your db.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

laravel eloquent revision history revisionable

29/05 2015

v1.0.8

1.0.8.0

Nice and easy way to handle revisions of your db.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

laravel eloquent revision history revisionable

17/05 2015
15/05 2015
14/05 2015
08/05 2015
08/05 2015
05/05 2015
23/03 2015