PHPackages                             visualbuilder/filament-versionable - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. visualbuilder/filament-versionable

ActiveLibrary[Database &amp; ORM](/categories/database)

visualbuilder/filament-versionable
==================================

Effortlessly manage revisions of your Eloquent models in Filament with polymorphic user support (Fork of mansoor/filament-versionable).

4.0.1(6mo ago)01.1k—9.1%[2 PRs](https://github.com/visualbuilder/filament-versionable/pulls)MITPHPPHP ^8.2CI passing

Since Oct 23Pushed 4mo agoCompare

[ Source](https://github.com/visualbuilder/filament-versionable)[ Packagist](https://packagist.org/packages/visualbuilder/filament-versionable)[ Docs](https://github.com/visualbuilder/filament-versionable)[ GitHub Sponsors](https://github.com/mansoor)[ RSS](/packages/visualbuilder-filament-versionable/feed)WikiDiscussions 4.x Synced 1mo ago

READMEChangelogDependencies (10)Versions (6)Used By (0)

[![Packagist Version](https://camo.githubusercontent.com/4914688ec1370afe54ec11d9d2724940a399ea6a708be474ca0505a75eaa3ae8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f76697375616c6275696c6465722f66696c616d656e742d76657273696f6e61626c65)](https://camo.githubusercontent.com/4914688ec1370afe54ec11d9d2724940a399ea6a708be474ca0505a75eaa3ae8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f76697375616c6275696c6465722f66696c616d656e742d76657273696f6e61626c65)[![run-tests](https://github.com/visualbuilder/filament-versionable/actions/workflows/run-tests.yml/badge.svg?branch=4.x)](https://github.com/visualbuilder/filament-versionable/actions/workflows/run-tests.yml)

Filament Versionable (Polymorphic User Fork)
============================================

[](#filament-versionable-polymorphic-user-fork)

**Fork of [mansoor/filament-versionable](https://github.com/mansoorkhan96/filament-versionable) with polymorphic user support**

This fork uses [visualbuilder/versionable](https://github.com/visualbuilder/versionable) which supports polymorphic user relationships, enabling version tracking across multiple user model types (User, Admin, Associate, EndUser, OrganisationUser, etc.).

Effortlessly manage your Eloquent model revisions in Filament. It includes:

- A Filament page to show the Diff of what has changed and who changed it
- A list of Revisions by different users
- A Restore action to restore the model to any state

[![](./resources/screenshot.png)](./resources/screenshot.png)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require visualbuilder/filament-versionable
```

Then, publish the config file and migrations:

```
php artisan vendor:publish --provider="Visualbuilder\Versionable\ServiceProvider"
```

Run the migration command:

```
php artisan migrate
```

Important

If you have not set up a custom theme and are using Filament Panels follow the instructions in the [Filament Docs](https://filamentphp.com/docs/4.x/styling/overview#creating-a-custom-theme) first.

After setting up a custom theme add the plugin's views and css to your theme css file.

```
@import '../../../../vendor/visualbuilder/filament-versionable/resources/css/plugin.css';
@source '../../../../vendor/visualbuilder/filament-versionable/resources/**/*.blade.php';
```

Usage
-----

[](#usage)

Add `Visualbuilder\Versionable\Versionable` trait to your model and set `$versionable` attributes.

**NOTE: Make sure to add `protected $versionStrategy = VersionStrategy::SNAPSHOT;` This would save all the $versionable attributes when any of them changed. There are different bug reports on using VersionStrategy::DIFF**

```
use Visualbuilder\Versionable\VersionStrategy;

class Post extends Model
{
    use Visualbuilder\Versionable\Versionable;

    protected $versionable = ['title', 'content'];

    protected $versionStrategy = VersionStrategy::SNAPSHOT;
}
```

Create a Revisons Resource page to show Revisions, it should extend the `Visualbuilder\FilamentVersionable\RevisionsPage`. If you were to create a Revisions page for `ArticleResource`, it would look like:

```
namespace App\Filament\Resources\ArticleResource\Pages;

use App\Filament\Resources\ArticleResource;
use Visualbuilder\FilamentVersionable\RevisionsPage;

class ArticleRevisions extends RevisionsPage
{
    protected static string $resource = ArticleResource::class;
}
```

Next, Add the ArticleRevisions page (that you just created) to your Resource

```
use App\Filament\Resources\ArticleResource\Pages;

public static function getPages(): array
{
    return [
        ...
        'revisions' => Pages\ArticleRevisions::route('/{record}/revisions'),
    ];
}
```

Add `RevisionsAction` to your edit/view pages, this action would only appear when there are any versions for the model you are viewing/editing.

```
use Visualbuilder\FilamentVersionable\Page\RevisionsAction;

protected function getHeaderActions(): array
{
    return [
        RevisionsAction::make(),
    ];
}
```

You can also add the `RevisionsAction` to your table.

```
use Visualbuilder\FilamentVersionable\Table\RevisionsAction;

$table->actions([
    RevisionsAction::make(),
]);
```

You are all set! Your app should store the model states and you can manage them in Filament.

Customisation
-------------

[](#customisation)

If you want to change the UI for Revisions page, you may publish the publish the views to do so.

```
php artisan vendor:publish --tag="filament-versionable-views"
```

If you want more control over how the versions are stored, you may read the [Visualbuilder Versionable Docs](https://github.com/visualbuilder/versionable) (based on overtrue/laravel-versionable).

Strip Tags from Diff
--------------------

[](#strip-tags-from-diff)

You can easily remove/strip HTML tags from the diff by just overriding `shouldStripTags` method inside your revisions page.

```
class ArticleRevisions extends RevisionsPage
{
    protected static string $resource = ArticleResource::class;

    public function shouldStripTags(): bool
    {
        return true;
    }
}
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Mansoor Ahmed](https://github.com/mansoorkhan96)
- [安正超](https://github.com/overtrue) for [Laravel Versionable](https://github.com/overtrue/laravel-versionable)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance72

Regular maintenance activity

Popularity19

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 53.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~40 days

Total

3

Last Release

126d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/133e7275d57b3053e870a66332b987ae0be489e1c61938f22196d42cf19d2be9?d=identicon)[ekoukltd](/maintainers/ekoukltd)

---

Top Contributors

[![mansoorkhan96](https://avatars.githubusercontent.com/u/51432274?v=4)](https://github.com/mansoorkhan96 "mansoorkhan96 (49 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (12 commits)")[![cannycookie](https://avatars.githubusercontent.com/u/500822?v=4)](https://github.com/cannycookie "cannycookie (9 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (8 commits)")[![CamilleScholtz](https://avatars.githubusercontent.com/u/5213535?v=4)](https://github.com/CamilleScholtz "CamilleScholtz (2 commits)")[![loanbesson](https://avatars.githubusercontent.com/u/43199197?v=4)](https://github.com/loanbesson "loanbesson (2 commits)")[![PovilasKorop](https://avatars.githubusercontent.com/u/1510147?v=4)](https://github.com/PovilasKorop "PovilasKorop (1 commits)")[![Proovt](https://avatars.githubusercontent.com/u/47065617?v=4)](https://github.com/Proovt "Proovt (1 commits)")[![aspirantzhang](https://avatars.githubusercontent.com/u/24559988?v=4)](https://github.com/aspirantzhang "aspirantzhang (1 commits)")[![vblinden](https://avatars.githubusercontent.com/u/1420356?v=4)](https://github.com/vblinden "vblinden (1 commits)")[![atmonshi](https://avatars.githubusercontent.com/u/1952412?v=4)](https://github.com/atmonshi "atmonshi (1 commits)")[![engelys](https://avatars.githubusercontent.com/u/8184085?v=4)](https://github.com/engelys "engelys (1 commits)")[![JarkaP](https://avatars.githubusercontent.com/u/3973865?v=4)](https://github.com/JarkaP "JarkaP (1 commits)")[![optima-agent](https://avatars.githubusercontent.com/u/270369846?v=4)](https://github.com/optima-agent "optima-agent (1 commits)")[![overtrue](https://avatars.githubusercontent.com/u/1472352?v=4)](https://github.com/overtrue "overtrue (1 commits)")

---

Tags

laravelfilamentRevisionsfilament-versionablevisualbuilderpolymorphic

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/visualbuilder-filament-versionable/health.svg)

```
[![Health](https://phpackages.com/badges/visualbuilder-filament-versionable/health.svg)](https://phpackages.com/packages/visualbuilder-filament-versionable)
```

###  Alternatives

[relaticle/custom-fields

User Defined Custom Fields for Laravel Filament

15828.6k](/packages/relaticle-custom-fields)[mansoor/filament-versionable

Effortlessly manage revisions of your Eloquent models in Filament.

10875.8k7](/packages/mansoor-filament-versionable)[guava/filament-modal-relation-managers

Allows you to embed relation managers inside filament modals.

7565.0k4](/packages/guava-filament-modal-relation-managers)[martinpetricko/filament-restore-or-create

FilamentPHP package that adds ability to check for similar deleted records and restore them instead of creating new ones.

112.3k](/packages/martinpetricko-filament-restore-or-create)[okeonline/filament-archivable

A filament plugin to use archivable models

208.1k](/packages/okeonline-filament-archivable)[tomatophp/filament-locations

Database Seeds for Countries / Cities / Areas / Languages / Currancy with ready to use resources for FilamentPHP

2320.8k6](/packages/tomatophp-filament-locations)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
