marshmallow/products

包含处理产品和准备它们用于电商的基本方法的包。

v3.0.4 2024-08-01 12:45 UTC

README

alt text

Marshmallow Products

此包将包含所有与产品相关的逻辑。产品通常与购物车或电商包一起使用。

安装

composer require marshmallow/products

将观察者添加到 AppServiceProvider.php

public function boot()
{
    ModelObserver::observe();
}
php artisan db:seed --class=Marshmallow\\Priceable\\Database\\Seeds\\VatRatesSeeder

安装后

php artisan marshmallow:resource Product Product
php artisan marshmallow:resource Supplier Product
php artisan marshmallow:resource ProductCategory Product
php artisan marshmallow:resource Price Priceable
php artisan marshmallow:resource VatRate Priceable
php artisan marshmallow:resource Currency Priceable
CURRENCY=eur

额外

factory(Marshmallow\Product\Models\Product::class, 10)->create();

帮助

如果工厂不工作,请在 config/database.php 中设置 'strict' => false,

...