Skip to content

shopavel/products

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Products package for Shopavel

Installation

Add "shopavel/products": "1.0.*" to your composer.json and run composer update.

This package is required by shopavel/shop, you will not normally have to specifically require this package.

Configuration

In app/config/app/php, add the provider:

'providers' => array(
    // ...
    'Shopavel\Products\ProductsServiceProvider',
),

And the alias:

'aliases' => array(
    // ...
    'Product' => 'Shopavel\Products\Product',
)

Usage

Product

You can use the Product alias to access the product eloquent model, e.g. Product::find(1);

Prices

There are several types of price associated with a product.

$product = Product::find(1);

foreach ($product->getPrices() as $price)
{
    echo $price->type . ': ' . $price->price;
}

You can access a specific price using:

echo $product->getPrice('retail');

Transactions

Create a new product

$product = new Product;
$product->name = 'Foo';
app('product.create')->create($product);

License

All Shopavel packages are open-sourced software licensed under the MIT license

About

Products package for Shopavel

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages