nickdekruijk / shopwire
一个简单、易于实现的Laravel 9购物车和结账包,使用Livewire。
Requires
- php: ^8.1
- laravel/framework: ^9.0|^10.0
- livewire/livewire: ^3.0
- mollie/laravel-mollie: ^2.8
- monarobase/country-list: ^3.0
- stevebauman/location: ^6.3
This package is auto-updated.
Last update: 2024-09-15 16:06:15 UTC
README
Shopwire
一个简单、易于实现的Laravel 9购物车和结账包,使用Livewire。
安装
要安装,请运行以下命令
composer require nickdekruijk/shopwire
在运行php artisan migrate之前,请确保您的Product模型已正确设置。
使用以下命令发布配置文件
php artisan vendor:publish --tag=config --provider="NickDeKruijk\Shopwire\ShopwireServiceProvider"
准备您的Product模型
添加ShopwireProduct特质
use NickDeKruijk\Shopwire\Traits\ShopwireProduct; class Product extends Model { use ShopwireProduct;
如果您的模型与默认模型(App\Models\Product)不同,您可以在配置文件中更改模型名称。
之后运行迁移命令: php artisan migrate
环境
要启用自动国家检测,请在.env文件中添加以下内容
LOCATION_TESTING=false
默认情况下,Shopwire使用Mollie作为支付提供商,在.env文件中设置您的Mollie API密钥
MOLLIE_KEY=test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Webhooks和Csrf
要使支付提供商webhooks正常工作,您可能需要更新app\Http\Middleware\VerifyCsrfToken.php
中的$except
数组
protected $except = [ 'shopwire/payment/webhook', ];
日志记录
您需要创建一个名为shopwire的日志通道,在config/logging.php
中添加如下内容
'shopwire' => [ 'driver' => 'single', 'path' => storage_path('logs/shopwire.log'), 'level' => 'debug', ],
管理员包集成
要管理产品/增值税/订单等,使用nickdekruijk/admin包,将模块按以下说明添加到您的config/admin.php
文件中。
一些带有数据的种子以开始使用
荷兰增值税 php artisan db:seed --class=NickDeKruijk\\Shopwire\\Seeds\\VatDutch
荷兰配送方式 php artisan db:seed --class=NickDeKruijk\\Shopwire\\Seeds\\ShippingDutch
许可
Shopwire是开源软件,许可协议为MIT许可。