
π Diff for Flarum 2.x

π Description
Diff allows you to view post edit histories on your Flarum forum. Track changes, compare revisions, and even rollback to previous versions.
This is the Flarum 2.x compatible fork of the original the-turk/flarum-diff extension by @the-turk. The original extension supports Flarum 1.8.x - this version has been updated to work with Flarum 2.0 and later.
Special thanks to Hasan Γzbey (the-turk) for creating this amazing extension! π
β¨ Screenshots

π Post-Stream Item

π Revision Dropdown List

π Key Features
- β
Multiple Detail Levels - Line (default), word, and character level diffs
- π¨ Three Render Modes - Inline, Side by Side & Combined views
- π¦ Archive Old Revisions - Save storage with automatic compression
- βͺ Rollback Support - Revert to any previous revision
- ποΈ Delete Revisions - Remove unwanted edit history
- π Dark Mode Support - Native Flarum 2.x dark mode compatible
- β° Cron Job Support - Automated archiving with scheduler
- π Quiet Edits Support - Works with
the-turk/flarum-quiet-edits
π₯ Installation
composer require huseyinfiliz/flarum-diff:"*"
php flarum migrate
php flarum cache:clear
β οΈ Upgrading from the-turk/flarum-diff
π΄ IMPORTANT: Database Backup Required
Before upgrading, you must backup your database. While our tests showed no data loss during migration, there is always a risk when upgrading major versions.
Your revision history data is stored in the post_edit_histories and post_edit_histories_archive tables.
βΉοΈ About Settings Migration
Extension settings from the-turk/flarum-diff (1.8.x) will not be transferred to this version due to namespace changes (the-turk-diff.* β huseyinfiliz-diff.*).
This is not a critical issue! After installing, simply configure your settings in the admin panel. This only affects display preferences (detail level, neighbor lines, merge threshold, etc.) and does not affect your revision history data. All stored revisions will work normally with default settings.
Upgrade Steps:
- Backup your database (mandatory!)
- Disable the old extension in admin panel
- Remove old extension:
composer remove the-turk/flarum-diff
- Upgrade Flarum to 2.0 (follow Flarum's upgrade guide)
- Install this extension:
composer require huseyinfiliz/flarum-diff:"*"
- Run migrations:
php flarum migrate
php flarum cache:clear
- Enable extension and configure settings
β
What's Preserved: All revision history data
βοΈ What Needs Reconfiguration: Extension settings (admin panel)
βοΈ Configuration
After installation, go to Admin Panel β Extensions β Diff to configure:
- Detail Level - None, Line, Word, or Character level
- Neighbor Lines - How many context lines to show
- Merge Threshold - For Combined renderer (0-1)
- Archive Options - Automatic archiving with A, m, b parameters
- Cron Jobs - Enable scheduled archiving
ποΈ Archive Old Revisions
If x β₯ A (where x is post's revision count), first y=mx+b revisions will be stored as merged & compressed. Configure A, m, and b values in settings.
For automated archiving, enable cron jobs and add this to your server:
* * * * * php /path/to/flarum schedule:run >> /dev/null 2>&1
Or run manually: php flarum diff:archive
π Permissions
Configure in Admin Panel β Permissions:
- View edit history - Who can see revision history
- Delete own/others edit history - Who can remove revisions
- Rollback own/others edit history - Who can revert to previous versions
β»οΈ Updating
composer update huseyinfiliz/flarum-diff
php flarum migrate
php flarum cache:clear
To remove: composer remove huseyinfiliz/flarum-diff
π Links
π Requirements
- PHP β₯ 8.1
- ext-iconv enabled
- Flarum 2.0+
π‘ Feedback & Suggestions
Feel free to share your ideas, report bugs, or request features in the discussion thread!
π Credits & Support
If you find this extension helpful:
- β Star the repository on GitHub
- π¬ Share feedback and suggestions