PHP code example of johannesschobel / laravel-revisionable
1. Go to this page and download the library: Download johannesschobel/laravel-revisionable library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
johannesschobel / laravel-revisionable example snippets
namespace App;
use Illuminate\Database\Eloquent\Model;
use JohannesSchobel\Revisionable\Traits\Revisionable;
class User extends Model
{
use Revisionable;
}
/*
* Set revisionable whitelist - only changes to any
* of these fields will be tracked during updates.
*/
protected $revisionable = [
'email',
'name'
];
protected $revisionEnabled = false;
protected $revisionLimitCleanup = true; // only works with revisionLimit
protected $revisionLimit = 50; // keep 50 instead of 20 revisions of this model