1. Go to this page and download the library: Download laraplug/shop library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
laraplug / shop example snippets
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');
}
}
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',
]
]
];
}
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());
...
}
}