Download the PHP package elvin-qulizade/filament-versions without Composer
On this page you can find all versions of the php package elvin-qulizade/filament-versions. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download elvin-qulizade/filament-versions
More information about elvin-qulizade/filament-versions
Files in elvin-qulizade/filament-versions
Package filament-versions
Short Description Snapshot-based version history and restore for Filament resources
License MIT
Homepage https://github.com/elvin-qulizade/filament-versions
Informations about the package filament-versions
Snapshot-based version history and restore for Filament resources
Adds WordPress-style version history to any Eloquent model used in a Filament v5 resource: every save is snapshotted, a "History" tab shows the timeline with a field-level diff, and any past version can be restored with one click.
Installation
You can install the package via composer:
[!IMPORTANT] If you have not set up a custom theme and are using Filament Panels follow the instructions in the Filament Docs first.
After setting up a custom theme add the plugin's views to your theme css file or your app's css file if using the standalone packages.
You can publish and run the migrations with:
You can publish the config file with:
Optionally, you can publish the views using
This is the contents of the published config file:
Usage
-
Add the trait and contract to any Eloquent model you want version history for:
- Register the History tab on the model's Filament resource:
That's it — every create/update is snapshotted automatically, the Edit page gets a "History" tab with a timeline, a field-level diff per version, and a one-click "Restore" action. To exclude fields from just one model in code, define protected array $versionExcept = [...] on it — or use the "Excluded fields" button on the History tab to manage it from the panel instead, per model class.
Select any two rows in the History table and use the "Compare" bulk action to diff them directly against each other, instead of only against the previous version.
Soft-deleted owner records keep working: their history and restore action remain reachable even while trashed.
Old versions beyond max_versions_per_model are pruned automatically after each save. To prune retroactively (e.g. after lowering the limit), run:
To run that automatically instead, set schedule.enabled to true in the config file (and schedule.cron if you want something other than daily at 3am).
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Elvin-Qulizade
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of filament-versions with dependencies
filament/filament Version ^5.0
spatie/laravel-package-tools Version ^1.15.0