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

ActiveLibrary

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

State keepers for Laravel application

2.1.1(3y ago)215MITPHPPHP &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 4d 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 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity69

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

1273d 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://www.gravatar.com/avatar/d2952c102bb79412537c5645720f8b6921f0a61de3dddd3be876cbae2773c96d?d=identicon)[putchi](/maintainers/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.

22.8k69.3k](/packages/grumpydictator-firefly-iii)[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[firefly-iii/data-importer

Firefly III Data Import Tool.

7545.8k](/packages/firefly-iii-data-importer)[gehrisandro/tailwind-merge-laravel

TailwindMerge for Laravel merges multiple Tailwind CSS classes by automatically resolving conflicts between them

341682.2k18](/packages/gehrisandro-tailwind-merge-laravel)[vemcogroup/laravel-sparkpost-driver

SparkPost driver to use with Laravel 6.x|7.x|8.x|9.x|10.x

421.7M1](/packages/vemcogroup-laravel-sparkpost-driver)[nickurt/laravel-akismet

Akismet for Laravel 11.x/12.x/13.x

97139.6k2](/packages/nickurt-laravel-akismet)

PHPackages © 2026

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