StateSet Embedded Commerce for PHP
Local-first commerce engine for PHP. Provides a complete commerce API with embedded SQLite storage.
Installation
Via Composer
Installing the Native Extension
The native extension provides significant performance benefits. Install pre-built binaries:
Or manually download from GitHub Releases.
Then add to your php.ini:
extension=stateset_embedded
Quick Start
Available APIs
| API | Description |
|---|---|
customers() |
Customer management |
orders() |
Order processing |
products() |
Product catalog |
inventory() |
Stock management |
returns() |
Return requests |
payments() |
Payment recording |
carts() |
Shopping carts |
analytics() |
Sales reports |
shipments() |
Shipment tracking |
warranties() |
Warranty management |
purchase_orders() |
Supplier orders |
invoices() |
Invoice management |
bom() |
Bills of materials |
work_orders() |
Manufacturing |
currency() |
Currency conversion |
subscriptions() |
Recurring billing |
promotions() |
Discount codes |
tax() |
Tax calculations |
Laravel Integration
Building from Source
Requirements:
- PHP 8.1+
- Rust toolchain
- PHP development headers (
php-dev/php-devel)
# The extension will be at:
# target/release/libstateset_embedded.so (Linux)
# target/release/libstateset_embedded.dylib (macOS)
# target/release/stateset_embedded.dll (Windows)
Running Tests
Platform Support
| Platform | PHP Versions | Status |
|---|---|---|
| Linux x86_64 | 8.1, 8.2, 8.3 | ✅ |
| Linux arm64 | 8.2, 8.3 | ✅ |
| macOS x86_64 | 8.2 | ✅ |
| macOS arm64 | 8.2, 8.3 | ✅ |
| Windows x86_64 | 8.2, 8.3 | ✅ |
License
MIT