RevisionAPI module
This package provides a trait which can be used to add version tracking functionality to an entity.
It uses mpociot/versionable under the hood, but you can use the trait (and interface) provided by this module directly.
Example
use Modules\RevisionApi\Traits\HasRevisionsTrait;
use Illuminate\Database\Eloquent\Model;
class ModelClass extends Model implements HasRevisionsInterface
{
use HasRevisionsTrait;
// You can now get the version history with $example->versions();
// You can get the previous version with $example->previousVersion();
// You can compare older versions with the current version $example->previousVersion()->diff()
// You can compare specific versions with $example->versions->get(4)->diff($example->versions->get(2))
// You can hide fields from versioning by setting the property
// protected $hidden = ['email', 'password'];
// You can prevent an update from creating a version
// $example->disableVersioning();
// You can revert to a previous version with $example->previousVersion()->revert();
// Your Model should include a 'status' attribute (short int) which will be saved with the versions.
// You can query Model by status:
// M$results = odel::withStatus(2);
// Or versions by status:
// $results = Model::versionsWithStatus(2);
// You can listen for status changes with the StatusChangeRevisionEvent event.
}