Download the PHP package mkd/laravel-state-management without Composer

On this page you can find all versions of the php package mkd/laravel-state-management. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-state-management

Laravel State Management

A state management solution for Laravel applications inspired by Redux, designed to manage complex application state across services, caching layers, and requests, with support for casting, default state handling, and custom methods.

Features

Installation

Install the package using Composer:

Basic Usage

Step 1: Create a Store

You can create a store class using the store:make Artisan command:

This command will generate a new store class in your app/Stores directory.

Step 2: Define Your Store

In the generated store, define your attributes and casts. The store will manage the state related to these attributes:

Step 3: Using a Store

To interact with a store and manage the state, you can retrieve the store instance and access its methods:

Step 4: Handling Persistent State

You can persist and rehydrate states based on a unique key, enabling state restoration between requests:

Step 5: Defining Custom Casts

If you need custom casting for certain attributes, use the store-cast:make command:

Then, define the casting logic in the generated cast class:

Store Rehydration Example

Commands

Example Stores

SettingsStore

This store manages application settings and allows for the dynamic update of user preferences.

UserNotification

This store handles sending notifications, such as emails, to users.

Persist

By Default Persist is saving the state object in cache so it can be easy rehydrated later with the key

You can override persist logic by implementing your own logic in store class

rehydrate

By Default rehydrate is setting the state from cache based on store key

You can override rehydrate logic by implementing your own logic in store class

License

This package is open-sourced software licensed under the MIT license.



All versions of laravel-state-management with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
laravel/framework Version ^8.0|^9.0|^10.0|^11.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mkd/laravel-state-management contains the following files

Loading the files please wait ....