Download the PHP package roddy/stateforge without Composer

On this page you can find all versions of the php package roddy/stateforge. 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 stateforge

StateForge ๐Ÿ”ฅ

Elegant, Isolated State Management for Laravel

Latest Version License

StateForge is a powerful, elegant state management package for Laravel that provides isolated, persistent state stores with automatic discovery and multiple persistence options. Built with developer experience in mind, it brings the simplicity of client-side state management to your Laravel applications.

๐Ÿ“– Table of Contents

โœจ Features

๐Ÿš€ Installation

Requirements

Install via Composer

Publish Configuration (Optional)

๐ŸŽฏ Quick Start

1. Create Your First Store

This creates app/Stores/CounterStore.php with the enhanced architecture:

2. Use in Controller

3. Add Routes

4. Test It Out!

Visit /counter in your browser and see the counter in action! Each browser will have its own isolated counter, and all state changes are automatically logged.

๐Ÿง  Core Concepts

Enhanced Store Architecture

StateForge 2.0 introduces a more structured store architecture:

Lifecycle Methods

  1. initializeState() - Define your state properties and methods
  2. middlewares() - Return array of custom middlewares
  3. onUpdate() - Called automatically after every state change
  4. Automatic Persistence - Based on $persistenceType

User Isolation

StateForge automatically isolates stores per user/browser combination:

Auto-discovery

Stores placed in app/Stores/ are automatically discovered and registered. No manual configuration needed!

๐Ÿ”„ Store Lifecycle

Complete Lifecycle Flow

Middleware System

Add custom behavior to your stores:

Automatic onUpdate() Handling

The onUpdate() method is called automatically after every state change:

๐Ÿ—๏ธ Store Examples

Shopping Cart Store with Lifecycle Hooks

User Preferences Store with Automatic Syncing

๐Ÿ“š API Reference

StateForge Facade

Store Instance Methods

๐Ÿ’พ Persistence Options

File Persistence (Default)

Cache Persistence

Session Persistence

No Persistence

โš™๏ธ Configuration

Default Configuration (config/stateforge.php)

๐Ÿš€ Advanced Usage

Using in Livewire Components

Using in Blade Views

Custom Middleware Classes

๐Ÿงน Maintenance

Cleanup Commands

Store Creation

๐Ÿ† Best Practices

Store Design

Performance

Security

๐Ÿ› Troubleshooting

Store returns null

Hooks not working

Persistence issues

โ“ FAQ

How does user isolation work?

StateForge uses a combination of:

  1. Persistent Cookie: Survives browser restarts
  2. Browser Fingerprinting: Fallback using user agent, language, etc.
  3. Client ID: Unique identifier per browser/user combination

Can I use StateForge with SPAs?

Yes! StateForge works perfectly with SPAs. Use the API endpoints to interact with stores from your frontend.

How is data persisted?

Only state data is persisted - methods (closures) are automatically reattached when stores are loaded.

Can I share stores between users?

No, stores are intentionally isolated per user. For shared state, use your database or cache directly.

What's the performance impact?

Minimal. StateForge is optimized for performance with lazy loading and efficient persistence.

Can I use multiple persistence types for different stores?

Yes! Each store can have its own persistence configuration.

๐Ÿ“„ License

StateForge is open-sourced software licensed under the MIT license.

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

๐Ÿ“„ License

StateForge is open-sourced software licensed under the MIT license.

๐Ÿ™ Acknowledgments


StateForge - Forge your application state with elegance and power! ๐Ÿ”ฅ

For more information, visit the GitHub repository or join our community.


All versions of stateforge with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/support Version ^9.0 || ^10.0 || ^11.0 || ^12.0
illuminate/contracts Version ^9.0 || ^10.0 || ^11.0 || ^12.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 roddy/stateforge contains the following files

Loading the files please wait ...