visualbuilder/filament-versionable
Filament plugin to manage Eloquent model revisions with polymorphic user support. View diffs, see who changed what, browse revision history, and restore any previous state. Built on visualbuilder/versionable for multi-user-model tracking.
Pros:
visualbuilder/versionable (fork of overtrue/laravel-versionable), enabling version tracking across multiple user models (e.g., User, Admin, OrganisationUser). Critical for multi-role systems (e.g., SaaS platforms, enterprise apps).VersionStrategy::SNAPSHOT) and diff-based tracking (though the README warns of bugs with DIFF). Snapshot is recommended for reliability.Cons:
RevisionsPage) and actions (RevisionsAction), which must be manually linked to existing resources.visualbuilder/versionable directly).Illuminate\Contracts\Auth\MustVerifyEmail or similar (check visualbuilder/versionable docs).VersionStrategy::DIFF has known issues (README warns against it). Snapshot may not suit all use cases (e.g., large BLOBs).overtrue/laravel-versionable directly if Filament UI isn’t critical.mansoor/filament-versionable may suffice.spatie/laravel-activitylog (lighter, but lacks Filament UI).laravel-nova-versioning if using Nova instead of Filament.Visualbuilder\Versionable\Contracts\VersionableUser (check visualbuilder/versionable docs).filament/filament:^5.0, laravel/framework:^11.0, and php:^8.2.composer require visualbuilder/filament-versionable
php artisan vendor:publish --provider="Visualbuilder\Versionable\ServiceProvider"
php artisan migrate
use Visualbuilder\Versionable\Versionable; trait to target models.$versionable attributes and $versionStrategy (prefer SNAPSHOT).class Post extends Model {
use Visualbuilder\Versionable\Versionable;
protected $versionable = ['title', 'content'];
protected $versionStrategy = VersionStrategy::SNAPSHOT;
}
RevisionsPage for each resource:
class PostRevisions extends RevisionsPage {
protected static string $resource = PostResource::class;
}
getPages():
public static function getPages(): array {
return [
'revisions' => Pages\PostRevisions::route('/{record}/revisions'),
];
}
RevisionsAction to edit/view pages and tables:
protected function getHeaderActions(): array {
return [RevisionsAction::make()];
}
versions table).php artisan vendor:publish --tag="filament-versionable-views"
saving, updating). Test with filament/spatie-laravel-medialibrary or similar.Cache::remember with model IDs).dispatch()) could desync versioning if not atomic.Post, Product).RevisionsPage and actions to resources.How can I help you explore Laravel packages today?