jmrashed/ecommerce
Composer 安装命令:
composer require jmrashed/ecommerce
包简介
Advanced E-commerce Toolkit for Laravel Application
关键字:
README 文档
README
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-phpfor Stripe payments.
Installation
-
Install via Composer:
composer require jmrashed/ecommerce
-
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
-
Run migrations:
php artisan migrate
-
(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
License
MIT. See LICENSE.
⭐ Star on GitHub
jmrashed/ecommerce 适用场景与选型建议
jmrashed/ecommerce 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 38 次下载、GitHub Stars 达 8, 最近一次更新时间为 2024 年 05 月 25 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「ecommerce」 「toolkit」 「laravel」 「shopping cart」 「payment gateway」 「laravel package」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 jmrashed/ecommerce 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 jmrashed/ecommerce 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 jmrashed/ecommerce 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Nevogate Payment Gateway SDK
Dealing with payments through the Egyptian payment gateway PayMob
Symfony2 Bundle that adds basic user account entity and city/state/country setup as well
Common helpers and classes for ICanBoogie
A PHP (and Laravel) package to interface with the Snipcart api.
Alfabank REST API integration
统计信息
- 总下载量: 38
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-05-25