marshmallow / priceable
Package for handeling prices
Installs: 7 004
Dependents: 2
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^8.0|^8.1
- laravel/nova: ^4.0|^5.0
- marshmallow/commands: ^1.0
- marshmallow/helpers: ^2.0
- marshmallow/sluggable: ^1.0
- moneyphp/money: ^v4.0.3
README
Marshmallow Products
Deze package gaat alle logica houden voor producten. Producten zullen in het algemeen gebruikt worden in combinatie met de Cart of Ecommerce package.
Installatie
composer require marshmallow/priceable
Vendor Publish
...
php artisan vendor:publish --provider="Marshmallow\Priceable\PriceableServiceProvider" --tag="config" --force
Methods
Currency::getUserCurrent(); Currency::getExceptUserCurrent()
Routes
@foreach (\Marshmallow\Priceable\Models\Currency::get() as $currency) <a href="{{ route('set-currency', $currency) }}"> {{ $currency->name }} </a> @endforeach
Available methods
currentPrice() isDiscounted() discountedFrom()
CURRENCY=eur
php artisan db:seed --class=Marshmallow\Product\Database\Seeds\VatRatesSeeder
To do
php artisan marshmallow:resource Price Priceable
php artisan marshmallow:resource VatRate Priceable
php artisan marshmallow:resource Currency Priceable
php artisan marshmallow:resource PriceType Priceable
Tests
Priceable is_can_make_use_of_the_price_facade
Currency //
VAT //
Price it_has_one_currency it_has_one_vat_rate it_makes_use_of_default_vatrate_id it_makes_use_of_default_currency_id it_calculates_including_price_correctly_from_excluding_amount it_calculates_excluding_price_correctly_from_excluding_amount it_calculates_vat_amount_correctly_from_excluding_amount it_calculates_including_price_correctly_from_including_amount it_calculates_excluding_price_correctly_from_including_amount it_calculates_vat_amount_correctly_from_including_amount it_returns_a_carbon_instance_for_valid_from it_returns_a_carbon_instance_for_valid_till
Extra
factory(Marshmallow\Product\Models\Product::class, 10)->create();
Tests during development
php artisan test packages/marshmallow/priceable
...