pictastudio / venditio-core
ecommerce core package
Fund package maintenance!
Picta Studio
Requires
- php: ^8.1
- illuminate/contracts: ^10.0
- spatie/laravel-activitylog: ^4.7
- spatie/laravel-package-tools: ^1.14.0
- spatie/laravel-permission: ^6.3
- spatie/laravel-query-builder: ^5.7
- spatie/laravel-sluggable: ^3.5
Requires (Dev)
- drradao/laravel-bard: ^0.3.0
- larastan/larastan: ^2.0.1
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.8
- orchestra/testbench: ^8.8
- pestphp/pest: ^2.34
- pestphp/pest-plugin-arch: ^2.5
- pestphp/pest-plugin-laravel: ^2.0
- pestphp/pest-plugin-type-coverage: ^2.8
README
Venditio core it's a headless e-commerce tool. It provides the core functionality for an e-commerce laravel based application, giving you the freedom to choose the frontend stack.
Installation
You can install the package via composer:
composer require pictastudio/venditio-core
You can install the package with:
php artisan venditio-core:install
This is the contents of the published config file:
return [ /* |-------------------------------------------------------------------------- | Auth |-------------------------------------------------------------------------- | | Specify the auth manager | */ 'auth' => [ 'manager' => AuthManager::class, ], /* |-------------------------------------------------------------------------- | Models |-------------------------------------------------------------------------- | | Specify the models to use | */ 'models' => [ 'address' => PictaStudio\VenditioCore\Models\Address::class, 'brand' => PictaStudio\VenditioCore\Models\Brand::class, 'cart' => PictaStudio\VenditioCore\Models\Cart::class, 'cart_line' => PictaStudio\VenditioCore\Models\CartLine::class, 'country' => PictaStudio\VenditioCore\Models\Country::class, 'country_tax_class' => PictaStudio\VenditioCore\Models\CountryTaxClass::class, 'currency' => PictaStudio\VenditioCore\Models\Currency::class, 'discount' => PictaStudio\VenditioCore\Models\Discount::class, 'inventory' => PictaStudio\VenditioCore\Models\Inventory::class, 'order' => PictaStudio\VenditioCore\Models\Order::class, 'order_line' => PictaStudio\VenditioCore\Models\OrderLine::class, 'product' => PictaStudio\VenditioCore\Models\Product::class, 'product_category' => PictaStudio\VenditioCore\Models\ProductCategory::class, 'product_custom_field' => PictaStudio\VenditioCore\Models\ProductCustomField::class, 'product_type' => PictaStudio\VenditioCore\Models\ProductType::class, 'product_item' => PictaStudio\VenditioCore\Models\ProductItem::class, 'product_variant' => PictaStudio\VenditioCore\Models\ProductVariant::class, 'product_variant_option' => PictaStudio\VenditioCore\Models\ProductVariantOption::class, 'shipping_status' => PictaStudio\VenditioCore\Models\ShippingStatus::class, 'tax_class' => PictaStudio\VenditioCore\Models\TaxClass::class, 'user' => PictaStudio\VenditioCore\Models\User::class, ], /* |-------------------------------------------------------------------------- | Pricing |-------------------------------------------------------------------------- | | Specify the pricing formatter | */ 'pricing' => [ 'formatter' => DefaultPriceFormatter::class, ], /* |-------------------------------------------------------------------------- | Decimal |-------------------------------------------------------------------------- | | Specify the decimal formatter | */ 'decimal' => [ 'formatter' => DefaultDecimalFormatter::class, ], /* |-------------------------------------------------------------------------- | Scopes |-------------------------------------------------------------------------- | | Scopes configuration | */ 'scopes' => [ 'in_date_range' => [ 'allow_null' => true, // allow null values to pass when checking date range 'include_start_date' => true, // include the start date in the date range 'include_end_date' => true, // include the end date in the date range ], ], ];
Usage
Api
By default the api routes provided by this package are public, with no authetication setup.
You should provide the authentication layer in your app using something like laravel/breeze
for SPA or other kinds of authentication.
Carts
Generator
Customize cart identifier generator Modify the bind in laravel container
$this->app->bind(CartIdentifierGeneratorInterface::class, CartIdentifierGenerator::class);
Orders
Generator
Customize order identifier generator Modify the bind in laravel container
$this->app->bind(OrderIdentifierGeneratorInterface::class, OrderIdentifierGenerator::class);
namespace App\Generators; use PictaStudio\VenditioCore\Models\Order; use PictaStudio\VenditioCore\Orders\Contracts\OrderIdentifierGeneratorInterface; class MyCustomGenerator implements OrderIdentifierGeneratorInterface { /** * {@inheritDoc} */ public function generate(Order $order): string { // ... return 'my-custom-reference'; } }
TODO:
- update outdated docs
- docs on binding of models and dtos into container
- pipeline docs
- docs on
OrderStatus
enum andContracts\OrderStatus
on how it's used and the logic behind it - docs on customizing validation rules
- fix updating cart lines in
CartUpdatePipeline
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.