Download the PHP package marshmallow/products without Composer
On this page you can find all versions of the php package marshmallow/products. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download marshmallow/products
More information about marshmallow/products
Files in marshmallow/products
Package products
Short Description Package that will contain basic methods for handeling products and preparing them toe be used in ecommerce.
License MIT
Homepage https://github.com/Marshmallow-Development/
Informations about the package products

Marshmallow Products
Basic building blocks for handling products and preparing them to be used in e-commerce. This package ships the Product, ProductCategory and Supplier models (with prices, SEO, slugs, soft deletes and flexible images) plus matching Laravel Nova resources. It is typically used together with Marshmallow's Cart or Ecommerce packages.
Requirements
- PHP
^8.1 - Laravel Nova
^5.0
Laravel Nova is a paid product. Make sure your Composer is authenticated against https://nova.laravel.com before installing.
Installation
Install the package via Composer:
The service provider is auto-discovered. It registers the package config and loads the package migrations automatically, so a php artisan migrate is all that is needed to create the products, product_categories, suppliers and pivot tables.
Register the product observer in your application's AppServiceProvider::boot() method:
Seed the default VAT rates (provided by marshmallow/priceable) so products can be priced:
Publishing the config
Optionally publish the config file to override the models, Nova resources and defaults:
After installation
Generate the Nova resources for this package (and for the Priceable resources it relies on) using the marshmallow:resource command from marshmallow/commands:
Set your default currency in your .env:
Configuration
The published config/product.php file exposes the following options:
| Key | Default | Description |
|---|---|---|
models.product |
Marshmallow\Product\Models\Product |
The Product Eloquent model. Override to use your own. |
models.product_category |
Marshmallow\Product\Models\ProductCategory |
The ProductCategory Eloquent model. |
models.supplier |
Marshmallow\Product\Models\Supplier |
The Supplier Eloquent model. |
nova.wysiwyg |
Laravel\Nova\Fields\Trix (env NOVA_WYSIWYG) |
The Nova field used for the product body. |
nova.prices_are_including_vat |
true |
Whether prices entered in Nova already include VAT. |
nova.defaults.currencies |
1 |
Default currency id used on new prices. |
nova.defaults.vat_rates |
3 |
Default VAT rate id used on new prices. |
nova.resources |
Marshmallow\Product\Nova\* |
The Nova resource classes for product, category and supplier (price resource comes from Priceable). |
nova.relationships.product_supplier |
Marshmallow\Product\Nova\Relationships\ProductSupplier::class |
The pivot definition for the product/supplier relationship. |
default_product_view |
shop.product |
The blade view used to render a product detail page. |
channels |
[] |
Optional sales channels (e.g. Bol.com) to expose the product on. |
Usage
The Product model
A Product is sluggable, SEO-able and priceable, uses soft deletes, and casts its images attribute to a Nova Flexible value. It exposes category() (belongs-to), categories() and suppliers() (belongs-to-many) relationships, all resolved through the configurable model classes.
Available scopes
| Scope | Description |
|---|---|
active() |
Only products where active = 1. |
withRelationships() |
Eager loads category, categories, suppliers and media. |
Stock status constants
Security Vulnerabilities
Please report security vulnerabilities by email to [email protected] rather than via the public issue tracker.
Credits
License
The MIT License (MIT). Please see the License File for more information.
All versions of products with dependencies
marshmallow/commands Version ^v1.2.1
marshmallow/seoable Version ^v5.0.1
marshmallow/sluggable Version ^v1.9.0
marshmallow/helpers Version ^v2.19.0
marshmallow/priceable Version ^v3.2.0
marshmallow/nova-flexible Version ^v5.1.0
laravel/nova Version ^5.0