marshmallow / priceable
处理价格的工具包
Requires
- php: ^8.0|^8.1
- laravel/nova: ^4.0
- marshmallow/commands: ^1.0
- marshmallow/helpers: ^2.0
- marshmallow/sluggable: ^1.0
- moneyphp/money: ^v4.0.3
- dev-master
- v3.1.1
- v3.1.0
- v3.0.0
- v2.2.0
- v2.1.0
- v2.0.1
- v2.0.0
- v1.6.0
- v1.5.2
- v1.5.1
- v1.5.0
- v1.4.4
- v1.4.3
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.1
- v1.2.0
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- dev-dependabot/github_actions/overtrue/phplint-9.0
- dev-dependabot/github_actions/actions/checkout-4
- dev-nova4
- dev-development
This package is auto-updated.
Last update: 2024-09-18 15:06:18 UTC
README
Marshmallow 产品
此包将包含所有产品逻辑。产品通常将与购物车或电子商务包一起使用。
安装
composer require marshmallow/priceable
供应商发布
...
php artisan vendor:publish --provider="Marshmallow\Priceable\PriceableServiceProvider" --tag="config" --force
方法
Currency::getUserCurrent(); Currency::getExceptUserCurrent()
路由
@foreach (\Marshmallow\Priceable\Models\Currency::get() as $currency) <a href="{{ route('set-currency', $currency) }}"> {{ $currency->name }} </a> @endforeach
可用方法
currentPrice() isDiscounted() discountedFrom()
CURRENCY=eur
php artisan db:seed --class=Marshmallow\Product\Database\Seeds\VatRatesSeeder
待办事项
php artisan marshmallow:resource Price Priceable
php artisan marshmallow:resource VatRate Priceable
php artisan marshmallow:resource Currency Priceable
php artisan marshmallow:resource PriceType Priceable
测试
Priceable is_can_make_use_of_the_price_facade
货币 //
增值税 //
价格它有一个货币它有一个增值税率它使用默认增值税率ID它使用默认货币ID它正确地从不含税金额计算含税价格它正确地从不含税金额计算不含税价格它正确地从不含税金额计算增值税金额它正确地从含税金额计算含税价格它正确地从含税金额计算不含税价格它正确地从含税金额计算增值税金额它返回有效的Carbon实例它返回有效的直到Carbon实例
附加
factory(Marshmallow\Product\Models\Product::class, 10)->create();
开发中的测试
php artisan test packages/marshmallow/priceable
...