How venturecraft/revisionable works
Project type and purpose
• This is an open-source Laravel package (“Revisionable”) that adds automatic revision-history tracking to any Eloquent model. It is not a standalone web app but a library you install via Composer into a Laravel application.
File structure
• src/
• Venturecraft/RevisionableServiceProvider.php – Laravel service provider
• RevisionableTrait.php – the Trait you “use” in your model
• Revisionable.php – legacy base class
• Revision.php – Eloquent model for the revisions table
• FieldFormatter.php – helper to format old/new values
• src/config/revisionable.php – published config file
• src/migrations – migration to create the revisions table
• tests/ – PHPUnit tests for the package
• composer.json, phpunit.xml, config files, CI settings
README for additional insights
• The package boots via a ServiceProvider, publishes config & migrations, hooks into Eloquent model events, writes to a “revisions” table, and fires “revisionable.*” events.
• It supports multiple auth drivers, configurable field-formatting, cleanup rules, and is entirely trait-based.
Detail—capture every piece of the architecture
• Trait hooking into multiple Eloquent lifecycle events
• Optional features (e.g., revisionForceDeleteEnabled flag, formatted fields, additional_fields in config)