This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.
This package is abandoned and no longer maintained. The author suggests using the karriere/state package instead.

Laravel package for storing current application state in cache/session

v2.0.0 2020-10-06 11:27 UTC


687474703a2f2f7777772e6b617272696572652e61742f696d616765732f6c61796f75742f6b61746c6f676f2e737667     Packagist Downloads

State package for Laravel

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


Run composer require karriere/state to install this package.


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

'providers' => [

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

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

// 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


To install the configuration file you simply use:

php artisan vendor:publish


  • 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


Apache License 2.0 Please see LICENSE for more information.