PHPackages                             putchi/state-keepers - 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. putchi/state-keepers

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

putchi/state-keepers
====================

State keepers for Laravel application

2.1.1(3y ago)115MITPHPPHP &gt;=8.0.0CI failing

Since Jun 20Pushed 3y ago1 watchersCompare

[ Source](https://github.com/putchi/state-keepers)[ Packagist](https://packagist.org/packages/putchi/state-keepers)[ RSS](/packages/putchi-state-keepers/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (8)Dependencies (2)Versions (9)Used By (0)

state-keepers
=============

[](#state-keepers)

State keepers for Laravel application

Any exception caught inside the closure will be handled and if necessary will rollback to previous app state so that no partial data will be stored on your Database.

### Prerequisites

[](#prerequisites)

This package is an extension to Laravel and will work only on laravel 5.7 and up-words

### Installing

[](#installing)

Clone or [Download](https://github.com/putchi/state-keepers/archive/master.zip) this [repo](https://github.com/putchi/state-keepers)or install it by using [composer](https://getcomposer.org/) bellow:

```
composer require putchi/state-keepers

```

You may publish project files (config, assets, translations, etc...) into your own project by running the bellow command:

```
php artisan vendor:publish --provider="StateKeepersServiceProvider"

```

Also you may need to clear config cache by running the following command:

```
php artisan config:cache

```

If you have trouble installing this package please view the list of issues [here](https://github.com/putchi/state-keepers/issues) or open a new one.

### Example of usage

[](#example-of-usage)

```
return StateManager::guard(function () {
  // Call some function in some model...
  // #  e.g: return Model::someFunction($arg1, $arg2);
  // Side note: don't forget to use whatever parameters you want in the declaration of the anonymous function (above)...
  // #  e.g: function () use ($arg1, $arg2) {...}
}, function (\Throwable $exception) {
  // HERE WE CATCH THE ERROR (IF THERE WAS ONE)
  // you can use the $exception to show the error massage like: $exception->getMessage();
  // Or you can implement your own customized catch callback in here.
});

```

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

[](#contributing)

You may [fork](https://github.com/putchi/state-keepers/fork) this repo or suggest new features (or new keepers) via pull requests and by following our code of conduct guide bellow.

Please read [CONTRIBUTING.md](https://gist.github.com/putchi/2e513d67249d6ea407da1bbaef1b8022) for details on our code of conduct, and the process for submitting pull requests to us.

[Watch](https://github.com/putchi/state-keepers/subscription) this project for changes, status or version updates.

Versioning
----------

[](#versioning)

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/putchi/state-keepers/tags).

Authors
-------

[](#authors)

- **Alex Rabinovich** - *Initial work* - [Putchi](https://github.com/putchi)

See also the list of [contributors](https://github.com/putchi/state-keepers/contributors) who participated in this project.

If you liked our work we did here please give us the thumbs up by [staring](https://github.com/putchi/state-keepers) this repo.

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~178 days

Recently: every ~309 days

Total

8

Last Release

1320d ago

Major Versions

1.0.4 → 2.0.12021-05-02

PHP version history (3 changes)1.0.0PHP &gt;=7.0

1.0.4PHP &gt;=7.1.3

2.0.1PHP &gt;=8.0.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10920796?v=4)[Alex Rabinovich](/maintainers/putchi)[@putchi](https://github.com/putchi)

---

Top Contributors

[![putchi](https://avatars.githubusercontent.com/u/10920796?v=4)](https://github.com/putchi "putchi (2 commits)")

---

Tags

db-transactionsgurdkeeperlaravellaravel-db-transactionslaravel-state-keeperlaravel-state-keepersstatetransactionslaravelstatetransactionstransactionalguardkeeperstate-keeperkeepers

### Embed Badge

![Health badge](/badges/putchi-state-keepers/health.svg)

```
[![Health](https://phpackages.com/badges/putchi-state-keepers/health.svg)](https://phpackages.com/packages/putchi-state-keepers)
```

###  Alternatives

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

23.9k69.5k](/packages/grumpydictator-firefly-iii)[statamic/cms

The Statamic CMS Core Package

4.8k3.6M962](/packages/statamic-cms)[backpack/crud

Quickly build admin interfaces using Laravel, Bootstrap and JavaScript.

3.4k3.7M223](/packages/backpack-crud)[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[firefly-iii/data-importer

Firefly III Data Import Tool.

8005.8k](/packages/firefly-iii-data-importer)[backpack/basset

Dead-simple way to load CSS or JS assets only once per page, when using Laravel 10+.

206971.5k11](/packages/backpack-basset)

PHPackages © 2026

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