Download the PHP package monurakkaya/opencart-eloquent without Composer
On this page you can find all versions of the php package monurakkaya/opencart-eloquent. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download monurakkaya/opencart-eloquent
More information about monurakkaya/opencart-eloquent
Files in monurakkaya/opencart-eloquent
Package opencart-eloquent
Short Description Eloquent support for OpenCart models
License MIT
Informations about the package opencart-eloquent
OPENCART-ELOQUENT
Yet another OpenCart database package for lazy laravel developers. I wrote this package to use with my OpenCart extensions. It does not replace whole opencart models with eloquent models. It just gives you the opportunity to use eloquent ORM flexibility while querying
INSTALLATION
-
First, install the package via composer:
-
Then copy ocmod file to your system directory
- Go to your admin panel and refresh modifications.
EXAMPLES
To get categories count which have products in it, just type:
To get categories with products count, just type:
Options and values
What about product options and option values?
Pagination
Easy right? :)
This project will be maintained as long as I continue to use OpenCart.
WRITING YOUR EXTENSION MODELS
just put your models in your upload/app directory.
Recommended way is follow opencart directory structure like:
upload/admin/controller/extension/module/product_video.php
upload/admin/view/template/extension/module/product_video.twig
upload/app/Models/Extension/Module/ProductVideo.php
then in your module controller just call:
OCMOD SUPPORT
You can easily modify original model files without touching any vendor file.
Each Model has comment lines //trait
at the beginning and //ocmod
at the end. just search and add after whatever you want.
with below code you can use name property as mutator so instead $product->description->name
you can use $product->name
:
RESULT
with below code you can do your modification with a trait.
RESULT
with below code you can create relation between opencart product model and your extension's model
RESULT
modification file will be stored to storage/modification/app/Models/Product/Product.php
All versions of opencart-eloquent with dependencies
illuminate/database Version ^5.8
illuminate/pagination Version ^5.8
illuminate/support Version ^5.8