laraplug / shop
Laravel Ecommerce Module built on top of AsgardCMS
Installs: 148
Dependents: 0
Suggesters: 0
Security: 0
Stars: 10
Watchers: 2
Forks: 6
Open Issues: 3
Type:asgard-module
Requires
- php: >=7.0.0
- barryvdh/laravel-cors: ^0.11.0
- composer/installers: ~1.0
- idavoll/core-module: ~3.0
- laraplug/attribute-module: 0.*
- laraplug/cart-module: 0.*
- laraplug/order-module: 0.*
- laraplug/product-module: 0.*
- laraplug/theme-module: 0.*
Requires (Dev)
- orchestra/testbench: 3.5.*
- phpunit/phpunit: ~6.0
This package is not auto-updated.
Last update: 2024-11-10 06:33:27 UTC
README
This module is currently under active development.
Need help! English Translation is incomplete. Any PR would be appreciated :)
Laraplug Shop
Laraplug Shop is a flexible, extendable e-commerce module, built on top of AsgardCMS platform.
Integrated with the modules below
laraplug/product-module
laraplug/attribute-module
laraplug/cart-module
laraplug/order-module
laraplug/theme-module (Deprecated)
Table Of Contents
Installation
-
Install the package via composer:
composer require laraplug/shop
-
Execute migrations via AsgardCMS's module command:
php artisan module:migrate Attribute php artisan module:migrate Product php artisan module:migrate Cart php artisan module:migrate Order --seed php artisan module:migrate Shop --seed
-
Execute publish via AsgardCMS's module command:
php artisan module:publish Attribute php artisan module:publish Product php artisan module:publish Cart php artisan module:publish Order php artisan module:publish Shop
-
Done!
Usage
Extend Product Model
To create your own Book
Product Eloquent model on BookStore
module, just extend the \Modules\Product\Entities\Product
model like this:
use Modules\Product\Entities\Product; class Book extends Product { // Override entityNamespace to identify your Model on database protected static $entityNamespace = 'bookstore/book'; // Override this method to convert Namespace into Human-Readable name public function getEntityName() { return trans('bookstore::books.title.books'); } }
Add EAV to Product model
Add $systemAttributes
to utilize laraplug/attribute-module on code-level like this:
use Modules\Product\Entities\Product; class Book extends Product { ... // Set systemAttributes to define EAV attributes protected $systemAttributes = [ 'isbn' => [ 'type' => 'input' ], 'media' => [ 'type' => 'checkbox', 'options' => [ 'audio-cd', 'audio-book', 'e-book', ] ] ]; }
Available SystemAttributes Parameters
type : String of input type (list below)
input
: input[type=text]textarea
: teaxarearadio
: input[type=radio]checkbox
: input[type=checkbox]select
: selectmultiselect
: select[multiple]
options : Array of option keys
has_translatable_values : boolean
Register Your Product
You can register your Entity using ProductManager
like this:
use Modules\Product\Repositories\ProductManager; use Modules\BookStore\Products\Book; class BookStoreServiceProvider extends ServiceProvider { ... public function boot() { ... // Register Book $this->app[ProductManager::class]->registerEntity(new Book()); ... } }
About Laraplug
LaraPlug is a opensource project to build e-commerce solution on top of AsgardCMS.
Contributing
We welcome any pull-requests or issues :)