Download the PHP package amreljako/cybercart without Composer
On this page you can find all versions of the php package amreljako/cybercart. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package cybercart
CyberCart
A secure, headless, high-performance embedded e-commerce core engine for Laravel. CyberCart is designed to be dynamically plugged into any existing Laravel application codebase seamlessly, without breaking your current database architecture. It features regional Arab and Gulf payment providers, atomic-locked inventory protection, and complete headless flexibility.
Key Features
Headless Architecture Focuses purely on core backend e-commerce logic, giving you complete freedom to design your UI using Blade, Livewire, Inertia, Vue, or React.
Race Condition Protection
Utilizes strict database pessimistic locking (lockForUpdate) and atomic database transactions to eliminate concurrent checkout anomalies or double-selling issues during high-traffic flash sales.
Regional Arab & Gulf Payments Native driver-based payment architecture supporting Paymob, Tamara, and Mada out of the box, with secure cryptographic webhook hash/signature validation layers.
Dynamic Barcode & QR Code Engine Zero-dependency, lightweight, on-the-fly generation of industrial barcodes (Code 128 standard) and QR codes as inline scalable vector graphics (SVG).
Polymorphic Binding Flexibility Seamlessly attaches to any existing database structure (Users, Clients, Admins) via custom configurable polymorphic relations.
Strict State Machine Lifecycle
Order status transitions strictly enforce integrity boundaries (Pending -> Processing -> Shipped -> Delivered), preventing unauthorized workflow mutations.
Directory Structure
Installation
1. Install via Composer
The package is published on Packagist, so it can be installed directly into your Laravel application:
2. Publish the configuration
Export the default configuration file to your application's config directory:
3. Run the migrations
Execute the database schema deployment to create the index-optimized e-commerce tables:
Configuration
Edit the generated config/cybercart.php file to adapt the package to your application:
Developer Demo Routes
CyberCart ships with built-in sandbox routes so you can verify the entire e-commerce pipeline locally in seconds, without writing any code first. They are auto-registered by the service provider under the cybercart prefix and run on the web middleware group.
Start your local server (php artisan serve) and visit:
/cybercart/cart-demo — Cart logic & race condition check
Creates (or reuses) a demo product variant (SKU: CYBER-DEMO-999, 5 in stock), adds 2 units to the cart through Cart::addToCart(), and returns a JSON response with the resulting cart contents plus the status of the integrity safeguards (pessimistic row locking and race condition mitigation).
/cybercart/checkout-demo — Secure checkout & live SVG rendering
Runs the demo variant through Checkout::execute() against the paymob driver, then renders the variant's Code 128 barcode and a deep-linked QR code as inline SVG on the page so you can visually confirm the rendering engine without any external graphics dependency. If no demo variant exists yet, it redirects to /cybercart/cart-demo first.
These routes are intended for local development and sandbox verification only — they should not be exposed in a production environment.
Usage
1. Bind a product variant
Attach the automatic barcode tracking trait to your product variant model:
2. Cart operations
Interact with the cart through static facade methods, which are protected against client-side tampering:
3. Run a secure checkout
Compile the order state, deduct inventory, lock the execution context, and generate a payment gateway redirect:
4. Render barcodes and QR codes
Display tracking identifiers without relying on external graphics extensions:
License
The MIT License (MIT). See the LICENSE file for full terms.