PHPackages                             mansoor/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. mansoor/filament-versionable

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

mansoor/filament-versionable
============================

Effortlessly manage revisions of your Eloquent models in Filament.

v5.1(2mo ago)108123.7k↑87.4%31[2 issues](https://github.com/mansoorkhan96/filament-versionable/issues)[2 PRs](https://github.com/mansoorkhan96/filament-versionable/pulls)7MITPHPPHP ^8.2CI passing

Since Mar 7Pushed 1w ago2 watchersCompare

[ Source](https://github.com/mansoorkhan96/filament-versionable)[ Packagist](https://packagist.org/packages/mansoor/filament-versionable)[ Docs](https://github.com/mansoorkhan96/filament-versionable)[ GitHub Sponsors](https://github.com/mansoor)[ RSS](/packages/mansoor-filament-versionable/feed)WikiDiscussions 5.x Synced 2d ago

READMEChangelog (10)Dependencies (23)Versions (28)Used By (7)

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

Filament Versionable
====================

[](#filament-versionable)

[![Latest Version on Packagist](https://camo.githubusercontent.com/af9649fa348eb853fae8a0b58866f0c1b4e48d807edf6fe1b8ab614bcc7509fe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d616e736f6f722f66696c616d656e742d76657273696f6e61626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mansoor/filament-versionable)[![Tests](https://github.com/mansoorkhan96/filament-versionable/actions/workflows/run-tests.yml/badge.svg)](https://github.com/mansoorkhan96/filament-versionable/actions/workflows/run-tests.yml)[![Code Style](https://github.com/mansoorkhan96/filament-versionable/actions/workflows/fix-php-code-styling.yml/badge.svg)](https://github.com/mansoorkhan96/filament-versionable/actions/workflows/fix-php-code-styling.yml)[![Total Downloads](https://camo.githubusercontent.com/fd930768af63bcbd627d7421a069e9d21b950a68b653eb36a3334f6c7f0e5914/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d616e736f6f722f66696c616d656e742d76657273696f6e61626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mansoor/filament-versionable)

Efforlessly 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 mansoor/filament-versionable
```

Then, publish the config file and migrations:

```
php artisan vendor:publish --provider="Overtrue\LaravelVersionable\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/mansoor/filament-versionable/resources/css/plugin.css';
@source '../../../../vendor/mansoor/filament-versionable/resources/**/*.blade.php';
```

Usage
-----

[](#usage)

Add `Overtrue\LaravelVersionable\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 Overtrue\LaravelVersionable\VersionStrategy;

class Post extends Model
{
    use Overtrue\LaravelVersionable\Versionable;

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

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

Create a Revisons Resource page to show Revisions, it should extend the `Mansoor\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 Mansoor\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 Mansoor\FilamentVersionable\Page\RevisionsAction;

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

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

```
use Mansoor\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 [Laravel Versionable Docs](https://github.com/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

62

—

FairBetter than 99% of packages

Maintenance92

Actively maintained with recent releases

Popularity51

Moderate usage in the ecosystem

Community32

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 64.6% 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 ~37 days

Recently: every ~65 days

Total

22

Last Release

66d ago

Major Versions

v0.0.13 → v4.0.0-beta.12025-06-24

v0.0.14 → v4.02025-08-08

v0.0.15 → 3.x-dev2025-08-08

3.x-dev → v5.02026-02-15

4.x-dev → v5.12026-04-10

PHP version history (2 changes)0.0.1PHP ^8.1

v4.0.0-beta.1PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/51432274?v=4)[Mansoor Ahmed](/maintainers/mansoorkhan96)[@mansoorkhan96](https://github.com/mansoorkhan96)

---

Top Contributors

[![mansoorkhan96](https://avatars.githubusercontent.com/u/51432274?v=4)](https://github.com/mansoorkhan96 "mansoorkhan96 (64 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (13 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)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (1 commits)")[![overtrue](https://avatars.githubusercontent.com/u/1472352?v=4)](https://github.com/overtrue "overtrue (1 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)")[![a21ns1g4ts](https://avatars.githubusercontent.com/u/11599205?v=4)](https://github.com/a21ns1g4ts "a21ns1g4ts (1 commits)")[![vblinden](https://avatars.githubusercontent.com/u/1420356?v=4)](https://github.com/vblinden "vblinden (1 commits)")[![aspirantzhang](https://avatars.githubusercontent.com/u/24559988?v=4)](https://github.com/aspirantzhang "aspirantzhang (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)")

---

Tags

revisionrevision-controlrevision-historyrevisionsversionableversionslaravelmansoorfilament-versionable

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[stephenjude/filament-jetstream

A Laravel starter kit built with Filament inspired by Jetstream.

17760.2k3](/packages/stephenjude-filament-jetstream)[stephenjude/filament-debugger

About

104162.2k2](/packages/stephenjude-filament-debugger)[wnx/laravel-backup-restore

A package to restore database backups made with spatie/laravel-backup.

213420.1k2](/packages/wnx-laravel-backup-restore)[croustibat/filament-jobs-monitor

Background Jobs monitoring like Horizon for all drivers for FilamentPHP

274325.8k8](/packages/croustibat-filament-jobs-monitor)

PHPackages © 2026

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