
Laravel Model versioning made easy
Versionable is an innovative approach to model versioning, designed specifically for Laravel applications. It provides a simple and efficient way to track changes to your models, allowing you to revert to previous versions effortlessly. This functionality is crucial for maintaining the integrity of your data while providing flexibility in development and debugging.
With Versionable, developers can focus more on building features and less on data management. The ease of installation and straightforward usage means that even those new to Laravel can implement robust version control for their models without hassle.
Easy Installation: Install via composer or publish migrations with simple commands; get started quickly without complex setups.
VersionableTrait: Just use the VersionableTrait in your desired models and start tracking changes with minimal code; the versioning magic happens automatically.
Custom Exclusions: Exclude specific attributes from versioning by defining an array property, ensuring only relevant changes are tracked, such as avoiding unnecessary updates for login timestamps.
Hidden Fields Tracking: Include hidden fields in version data by adding them to the versionedHiddenFields property, allowing for comprehensive version histories.
Version Limit Control: Set a limit on the number of stored versions per model by using a $keepOldVersions property, helping manage storage and performance.
Version Retrieval: Access all versions associated with a model via the versions attribute, making it simple to navigate through your data's history.
Diff Method: quickly compare two versions with the diff method, providing an associative array that highlights changes in attributes.
Revert Functionality: Easily revert to previous versions, whether it's the last version or any specific version ID, giving you full control over your data's state.
