The package offers a set of configuration options.
If you would like to revision only specific fields of the model, you can define them like so:
/* * Set revisionable whitelist - only changes to any * of these fields will be tracked during updates.*/protected$revisionable= ['email','name' ];
This way, only the fields email and name are tracked and store as revision in the database. The default behaviour
is to revision all fields.
If you want to disable revisions for a specific model just add the following variables to your model
You can further specify that you only want to clean up old revisions of a model. By doing so, you can further define,
how many revisions of one model you would like to keep in your database (default is set to 20). Say, if you add the 21st
revision, the first one is deleted.
You may customize this behaviour for each model by changing the variables
protected$revisionLimitCleanup=true; // only works with revisionLimitprotected$revisionLimit=50; // keep 50 instead of 20 revisions of this model
Rollback (aka load old revisions)
Of course, you can rollback to an old revision of your model. The Trait added earlier (e.g., the Revisionable trait)
already provides handy methods for you - so you don't need to worry about this.
You can either use the $model->rollbackToTimestamp($timestamp) or $model->rollbackSteps($steps) functions for this
purpose. Note that there is a configuration flag revisionable.rollback.cleanup (default false) that indicates,
whether the revisions rolled back should be deleted (true) or not (false).
Both functions return the rolled back model, which is already persisted in the database.