PHPackages                             fetzi/state - 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. [Caching](/categories/caching)
4. /
5. fetzi/state

Abandoned → [karriere/state](/?search=karriere%2Fstate)Library[Caching](/categories/caching)

fetzi/state
===========

Laravel package for storing current application state in cache/session

v3.3.0(2mo ago)171091Apache-2.0PHPPHP ^8.2CI passing

Since Nov 25Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/karriereat/state)[ Packagist](https://packagist.org/packages/fetzi/state)[ Docs](https://github.com/karriereat/state)[ RSS](/packages/fetzi-state/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)Dependencies (7)Versions (17)Used By (0)

[![](https://raw.githubusercontent.com/karriereat/.github/main/profile/logo.svg)](https://www.karriere.at/) [![](https://github.com/karriereat/state/workflows/CI/badge.svg)](https://github.com/karriereat/state/workflows/CI/badge.svg)[![Packagist Downloads](https://camo.githubusercontent.com/4cb6098d88ee0a0d569b0c649fc5a989473fcd5d111309bd7fa28e7f443b2ed3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b617272696572652f73746174652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/karriere/state)

State package for Laravel
=========================

[](#state-package-for-laravel)

This laravel package allows to store a certain application state in either the session or inside a cache.

Installation
------------

[](#installation)

Run `composer require karriere/state` to install this package.

Usage
-----

[](#usage)

To enable the package you need to reference the `StoreServiceProvider` class inside your `config/app.php` file in the `providers` section:

```
'providers' => [
    ...
    Karriere\State\StateServiceProvider::class,
    ...
];
```

To store the application state you create a state object and store it:

```
$state = $stateFactory->build('state-name', ['key' => 'value']);
$store->put($state);

// pass on $state->identifier()
```

In a later situation where you have the state identifier you can access the states data by:

```
$state = $store->get($identifier);

if(!$state->isEmpty()) {
  // use either $state->collection() or $state->raw() to access the state data
}
```

Configuration
-------------

[](#configuration)

To install the configuration file you simply use:

```
php artisan vendor:publish

```

### Options

[](#options)

- `storage`: session|cache
- `storage-prefix`: prefix that is added to the store identifier
- `expires-after`: defines the expires after time in seconds, only used for `CacheStore`

License
-------

[](#license)

Apache License 2.0 Please see [LICENSE](LICENSE) for more information.

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance83

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity84

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 90.3% 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 ~259 days

Recently: every ~356 days

Total

14

Last Release

86d ago

Major Versions

v0.3.1 → v1.0.02017-07-31

v1.0.0 → v2.0.02020-10-06

v2.2.0 → v3.0.02023-03-01

PHP version history (8 changes)v0.1.0PHP &gt;=5.6

v1.0.0PHP &gt;=7.0

v2.0.0PHP &gt;=7.2

v2.1.0PHP ^7.4 | ^8.0

v3.0.0PHP 8.0.\* | 8.1.\* | 8.2.\*

v3.1.0PHP 8.1.\* || 8.2.\*|| 8.3.\*

v3.2.0PHP 8.1.\* || 8.2.\*|| 8.3.\* || 8.4.\*

v3.3.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/b155d5296b644a0e937677b500bee7983ce4a91294b616d7a690e57f5b14a3aa?d=identicon)[fetzi](/maintainers/fetzi)

---

Top Contributors

[![fetzi](https://avatars.githubusercontent.com/u/3509426?v=4)](https://github.com/fetzi "fetzi (65 commits)")[![lentex](https://avatars.githubusercontent.com/u/9319316?v=4)](https://github.com/lentex "lentex (4 commits)")[![hofflepuff](https://avatars.githubusercontent.com/u/54941160?v=4)](https://github.com/hofflepuff "hofflepuff (1 commits)")[![jaylinski](https://avatars.githubusercontent.com/u/1668766?v=4)](https://github.com/jaylinski "jaylinski (1 commits)")[![k9ordon](https://avatars.githubusercontent.com/u/102591?v=4)](https://github.com/k9ordon "k9ordon (1 commits)")

---

Tags

laravelloginstatelaravelcachestackstatesessionlogincacheable

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[karriere/state

Laravel package for storing current application state in cache/session

1718.5k](/packages/karriere-state)[spatie/laravel-responsecache

Speed up a Laravel application by caching the entire response

2.8k8.2M51](/packages/spatie-laravel-responsecache)[awssat/laravel-visits

Laravel Redis visits counter for Eloquent models

975163.6k2](/packages/awssat-laravel-visits)[dragon-code/laravel-cache

An improved interface for working with cache

6844.8k10](/packages/dragon-code-laravel-cache)[nexxai/laravel-cfcache

A handful of Cloudflare cache helpers for Laravel

1317.7k](/packages/nexxai-laravel-cfcache)[alajusticia/laravel-logins

Session management in Laravel apps, user notifications on new access, support for multiple separate remember tokens, IP geolocation, User-Agent parser

2011.0k](/packages/alajusticia-laravel-logins)

PHPackages © 2026

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