Skip to content

jmrashed/ecommerce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Advanced E-commerce Toolkit for Laravel

Latest Version on Packagist Total Downloads PHP Version Laravel Version License

Introduction

The Advanced E-commerce Toolkit is a comprehensive Laravel package that provides everything needed to build a full-featured online store. It includes product catalog management (with variants/attributes), shopping cart, wishlist, checkout flow, Stripe/PayPal payments, order management, customer dashboards, admin panel, API endpoints, inventory tracking, coupons, reviews, shipping zones, loyalty points, and more.

Key benefits:

  • Production-ready with migrations, factories, seeders, tests.
  • Modular services (CartService, OrderService, PaymentService).
  • Responsive Blade views for frontend + API support.
  • Easy installation via Artisan commands.

Perfect for Laravel developers building SaaS, marketplaces, or custom stores.

Requirements

Requirement Version
PHP ^8.2
Laravel ^10.0 |^11.0 |^12.0 |^13.0
Laravel Sanctum ^3.0 |^4.0
darkaonline/l5-swagger ^8.5 |^9.0 |^10.0

Optional (suggested):

  • stripe/stripe-php for Stripe payments.

Installation

  1. Install via Composer:

    composer require jmrashed/ecommerce
  2. Install package (registers provider, publishes assets):

    php artisan ecommerce:install

    Or manually:

    php artisan vendor:publish --provider=\"Jmrashed\\Ecommerce\\EcommerceServiceProvider\" --tag=ecommerce-config
    php artisan vendor:publish --tag=ecommerce-views
    php artisan vendor:publish --tag=ecommerce-assets
  3. Run migrations:

    php artisan migrate
  4. (Optional) Seed demo data:

    php artisan ecommerce:seed

Configuration

Copy config/ecommerce.php and update .env:

# Payments
STRIPE_KEY=pk_test_xxx
STRIPE_SECRET=sk_test_xxx
PAYPAL_CLIENT_ID=xxx
PAYPAL_SECRET=xxx

# Store
ECOMMERCE_CURRENCY=USD
ECOMMERCE_TAX_RATE=0.08
ECOMMERCE_DEFAULT_SHIPPING=5.00

# Other (full list in config/ecommerce.php)

Usage Examples

Products & Cart

use Jmrashed\Ecommerce\Services\CartService;
use Jmrashed\Ecommerce\Models\Product;

// Add to cart
$cartService = app(CartService::class);
$cartService->add(1, 2); // product ID, quantity

// Totals with tax/shipping
$total = $cartService->getTotal();
$tax = $cartService->calculateTax($subtotal);

Checkout & Orders

use Jmrashed\Ecommerce\Services\OrderService;

// Create order from cart
$order = $orderService->createFromCart($userId, $address);

Payments

use Jmrashed\Ecommerce\Services\PaymentService;

$paymentService = app(PaymentService::class);
$payment = $paymentService->processStripe($order, $token);

Full API: /api/ecommerce/products, /api/ecommerce/cart, etc.

Publishing Assets

php artisan vendor:publish --tag=ecommerce-views    # Blade templates
php artisan vendor:publish --tag=ecommerce-assets   # CSS/JS

Key Features Tables

Models

Model Purpose
Product Catalog with images, variants, attributes
Category/Brand/Tag Organization
CartItem/Wishlist Session-based
Order/OrderItem Full lifecycle
Payment/Refund Gateways
Customer/Address Accounts
Review/Coupon Engagement

Services

Service Features
CartService Add/remove, totals, tax/shipping calc
OrderService Create, status update
PaymentService Stripe/PayPal/COD
ProductService Search/filter

Routes

Web: /products, /cart, /checkout, /customer/*, /admin/ecommerce/* API: /api/ecommerce/* (auth/products/cart/orders/payments)

Testing

composer test                          # All tests
composer test:unit                     # Unit
composer test:feature                  # Feature
composer test:coverage                 # Coverage report

Scripts use ./run-tests.sh.

Contributing

See CONTRIBUTING.md.

Security

Report to SECURITY.md or jmrashed@gmail.com.

Changelog

CHANGELOG.md.

License

MIT. See LICENSE.


⭐   Star on GitHub

About

The E-commerce Toolkit for Laravel is a modular package providing essential features for building e-commerce websites. This package includes functionalities for managing product catalogs, carts, checkout systems, payment gateway integrations, and order management.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages