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.

v4.0(9mo ago)10875.8k↓12%31[5 issues](https://github.com/mansoorkhan96/filament-versionable/issues)[4 PRs](https://github.com/mansoorkhan96/filament-versionable/pulls)7MITPHPPHP ^8.2CI passing

Since Mar 7Pushed 1mo 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 4.x Synced 1mo ago

READMEChangelog (10)Dependencies (11)Versions (22)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)[![run-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)[![GitHub Code Style Action Status](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

57

—

FairBetter than 98% of packages

Maintenance75

Regular maintenance activity

Popularity49

Moderate usage in the ecosystem

Community30

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 64.5% 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 ~48 days

Total

20

Last Release

92d 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 → 4.x-dev2026-02-15

4.x-dev → 5.x-dev2026-02-15

PHP version history (2 changes)0.0.1PHP ^8.1

v4.0.0-beta.1PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/76515e51b221a3505c36acda921bef4520c4b621091233a94b52836a6231bac4?d=identicon)[mansoorkhan96](/maintainers/mansoorkhan96)

---

Top Contributors

[![mansoorkhan96](https://avatars.githubusercontent.com/u/51432274?v=4)](https://github.com/mansoorkhan96 "mansoorkhan96 (60 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (12 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)")[![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

[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[spatie/laravel-model-flags

Add flags to Eloquent models

4301.1M1](/packages/spatie-laravel-model-flags)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[spatie/laravel-sql-commenter

Add comments to SQL queries made by Laravel

1931.4M1](/packages/spatie-laravel-sql-commenter)[spatie/laravel-deleted-models

Automatically copy deleted records to a separate table

409109.8k4](/packages/spatie-laravel-deleted-models)[wnx/laravel-backup-restore

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

203330.1k2](/packages/wnx-laravel-backup-restore)

PHPackages © 2026

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