Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Filament Versionable

Filament Versionable Laravel Package

mansoor/filament-versionable

Filament plugin for managing Eloquent model revisions with Overtrue Laravel Versionable. View revision history, see diffs of what changed and who changed it, and restore any previous version from a dedicated Filament page.

View on GitHub
Deep Wiki
Context7

Effortlessly manage revisions of your Eloquent models in Filament.

Frequently asked questions about Filament Versionable
How do I integrate this package with an existing Filament v4/v5 admin panel?
First, install the package via Composer, then publish Laravel Versionable’s migrations and run them. Create a custom Filament theme if you don’t have one, then import the plugin’s CSS and Blade views into your theme’s CSS file. Finally, add the `Versionable` trait to your Eloquent models and define which fields to version.
What Laravel and Filament versions does this package support?
This package requires **Filament v4 or v5** and **Laravel Versionable v5+**, which itself needs **PHP 8.1+**. Check your project’s compatibility before installing. Filament v3 is not supported.
Should I use snapshot or diff strategy for versioning?
Use **snapshot strategy** (default) for reliability, as the diff strategy has known bugs. Snapshots store full copies of versioned attributes, ensuring data integrity but consuming more storage. Configure it in your model with `protected $versionStrategy = VersionStrategy::SNAPSHOT;`
How do I restrict versioning to specific model fields?
Define the `$versionable` array in your Eloquent model to specify which fields to track. For example, `protected $versionable = ['title', 'content']` will only version those fields. This reduces storage overhead and keeps history focused on critical data.
Does this package work with UUID-based primary keys?
Yes, but there was a bug in versions before **v4.0** that broke `showVersion` for UUIDs. Ensure you’re using the latest version. If issues persist, verify your model’s primary key type and check the package’s changelog for updates.
Can I customize the revision history UI in Filament?
The package provides a dedicated `RevisionsPage` and `RevisionsAction` that integrate seamlessly with Filament’s design system. You can extend or override the Blade views in your custom theme to modify the UI. CSS can also be adjusted via the imported `plugin.css` file.
What happens if my database grows with many revisions? Will performance degrade?
Performance depends on your dataset size. Large revision tables may slow queries, especially without indexing. Consider adding indexes to the `versions` table or implementing archiving strategies for older revisions. The package doesn’t include built-in pagination for revisions, so Filament’s default pagination applies.
How do I handle HTML content in versioned fields (e.g., rich text editors)?
Use the `shouldStripTags()` method in your model to automatically strip HTML from versioned fields. This prevents rendering issues in diff views. Example: `protected function shouldStripTags(): bool { return true; }` for fields like `content`.
Is there a way to audit or notify users when a version is restored?
The package doesn’t natively support audit logging or notifications for restores. You’ll need to manually implement this using Laravel’s **events** or **observers** to log restores or trigger notifications via services like Laravel Echo or email.
What alternatives exist if I don’t want to use this package?
Alternatives include **manual versioning** (custom middleware + database triggers) or other Laravel packages like **spatie/laravel-activitylog** for simpler audit trails. However, this package is the most **Filament-specific** solution, offering a dedicated UI for diffs and restores without extra setup.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky