PHPackages                             fico7489/laravel-revisionable-upgrade - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. fico7489/laravel-revisionable-upgrade

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

fico7489/laravel-revisionable-upgrade
=====================================

Upgrade for the venturecraft revisionable package, add many useful methods.

3.0.4(5y ago)5339.2k—0%11MITPHP

Since Nov 25Pushed 3y ago4 watchersCompare

[ Source](https://github.com/fico7489/laravel-revisionable-upgrade)[ Packagist](https://packagist.org/packages/fico7489/laravel-revisionable-upgrade)[ Docs](https://github.com/fico7489/laravel-revisionable-upgrade)[ RSS](/packages/fico7489-laravel-revisionable-upgrade/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (4)Versions (13)Used By (0)

Laravel revisionable upgrade
============================

[](#laravel-revisionable-upgrade)

Upgrade for the [Venturecraft Revisionable](https://github.com/VentureCraft/revisionable) package, many useful methods are added.

Why to use
----------

[](#why-to-use)

Yeah, revisionable package has userResponsible () method, but that is not enough and we can use saved revisions for much more useful stuff. We can find out who created, deleted and edited model, when the model was edited, when exact attribute from the model was edited and much more.

- You don't need to add **updated\_by**, **deleted\_by**, **created\_by** to your tables.
- You don't need to add **updated\_attribute\_by** to your tables.
- You don't need to add **updated\_attribute\_to\_value\_by** to your tables.
- You don't need to add **updated\_attribute\_from\_value\_to\_value\_by** to your tables.
- You don't need to add **updated\_attribute\_at** to your tables.
- You don't need to add **updated\_attribute\_to\_value\_at** to your tables.
- You don't need to add **updated\_attribute\_from\_value\_to\_value\_at** to your tables.
- You don't need **author\_id**, **created\_user\_id**, **deleted\_user\_id** etc. or anything like that

Don't pollute your tables with above table columns in the database, all above information is already stored in revisions table we just need the ability to get them, and this package will help you with that.

Version Compatibility
---------------------

[](#version-compatibility)

The package is available for larvel 5.\* versions

Install
-------

[](#install)

1.Install package with composer

```
composer require fico7489/laravel-revisionable-upgrade:"*"

```

2.Use Fico7489\\Laravel\\RevisionableUpgrade\\Traits\\RevisionableUpgradeTrait trait in your base model or only in particular models. Model which use RevisionableUpgradeTrait must also use RevisionableTrait;

```
...
use Venturecraft\Revisionable\RevisionableTrait;
use Fico7489\Laravel\RevisionableUpgrade\Traits\RevisionableUpgradeTrait;

abstract class BaseModel extends Model
{
    use RevisionableTrait;
    use RevisionableUpgradeTrait;

    //enable this if you want use methods that gets information about creating
    protected $revisionCreationsEnabled = true;
...

```

and that's it, you are ready to go.

New methods
-----------

[](#new-methods)

- **userCreated()**Returns user which created this model
- **userDeleted()**Returns user which deleted this model
- **userUpdated($key = null, $newValue = null, $oldValue = null)**Returns user which updated this model (last user if there are more)
- **revisionCreated()**Returns revision for model created
- **revisionDeleted()**Returns revision for model deleted
- **revisionUpdated($key = null, $newValue = null, $oldValue = null)**Returns revision for model updated (last revision if there are more)
- **dateUpdated($key = null, $newValue = null, $oldValue = null)**Returns date(Carbon\\Carbon) for model updated (last revision if there are more)
- **revisionsUpdated($key = null, $newValue = null, $oldValue = null)**Returns revisions for model updated
- **usersUpdated($key = null, $newValue = null, $oldValue = null)**Returns users for model updated

Clarification for methods with **($key = null, $newValue = null, $oldValue = null)**

- All parameters are optional
- If you provide $key method will look for changes on that key/field
- If you provide $newValue method will look for changes where key/field is changed to this value
- If you provide $oldValue method will look for changes where key/field is changed from this value

We don't need **dateCreated** and **dateDeleted** because information about this is stored in created\_at and deleted\_at. We don't need **revisionsCreated**, **revisionsDeleted**, **usersCreated**, **usersDeleted** because model can be created or deleted only once. Methods which returns **user** and **users** are using model from **auth.model** configuration.

See some action
---------------

[](#see-some-action)

```
$seller = Seller::create(['email' => 'test@test.com']);

//get user who edited model
$seller->userCreated();

//get user who deleted model
$seller->userDeleted();

//get user who updated model
$seller->userUpdated();

//get user who updated attribute name in model
$seller->userUpdated('name');

//get user who updated attribute name value to 'new_name'
$seller->userUpdated('name', 'new_name');

//get user who updated attribute name value to 'new_name' value from 'old_name' value
$seller->userUpdated('name', 'new_name',  'old_name');

//get revision model for create
$seller->revisionCreated();

//get revision model for delete
$seller->revisionDeleted();

//get revision model for update
$seller->revisionUpdated();

//get date for update
$seller->dateUpdated();

//get revisions for update
$seller->revisionsUpdated();

//get users for update
$seller->usersUpdated();

```

Improtant notes
---------------

[](#improtant-notes)

Models where you want use this package must use created\_at timestamp

If you want fetch users that have deleted models you must enable $revisionCreationsEnabled

```
protected $revisionCreationsEnabled = true;

```

[See more](https://github.com/VentureCraft/revisionable)

License
-------

[](#license)

MIT

**Free Software, Hell Yeah!**

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity41

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 96% 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 ~94 days

Recently: every ~255 days

Total

12

Last Release

2059d ago

Major Versions

1.2.x-dev → 3.0.02017-12-09

### Community

Maintainers

![](https://www.gravatar.com/avatar/949b29f724c44fb480deeab36c7c50624f1351bec04a5045546f6d9f7334dd27?d=identicon)[fico7489](/maintainers/fico7489)

---

Top Contributors

[![fico7489](https://avatars.githubusercontent.com/u/4559663?v=4)](https://github.com/fico7489 "fico7489 (48 commits)")[![alberto-bottarini](https://avatars.githubusercontent.com/u/1442934?v=4)](https://github.com/alberto-bottarini "alberto-bottarini (1 commits)")[![leondeng](https://avatars.githubusercontent.com/u/1560766?v=4)](https://github.com/leondeng "leondeng (1 commits)")

---

Tags

createdbydeletedbylaravelrevisionableupdatedbyuserstampslaravel revisionable upgradelaravel updated\_by laravel deleted\_bylaravel created\_bylaravel updated\_at by key

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/fico7489-laravel-revisionable-upgrade/health.svg)

```
[![Health](https://phpackages.com/badges/fico7489-laravel-revisionable-upgrade/health.svg)](https://phpackages.com/packages/fico7489-laravel-revisionable-upgrade)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

20917.2M158](/packages/orchestra-canvas)[illuminatech/balance

Provides support for Balance accounting system based on debit and credit principle

16137.4k](/packages/illuminatech-balance)[zonneplan/laravel-module-loader

Module loader for Laravel

24118.4k](/packages/zonneplan-laravel-module-loader)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[glhd/special

1929.4k](/packages/glhd-special)

PHPackages © 2026

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