User Feedback
Description
Allows OpenCart code to use Eloquent/Query Builder methods to work with database tables instead of ‘raw’ SQL queries.
Version support
OpenCart 2/3: OCMOD modifier corrects catalog/controller/startup/startup.php and admin/controller/startup/startup.php.
OpenCart 4: register startup in module install() method, without core edits.
Requirements
PDO extension for MySQL (pdo_mysql)
Usage
In the file system/library/eloquent.php, the QB class
class QB extends \Illuminate\Database\Capsule\Manager {}
The QB class is available immediately:
// via the facade $users = QB::table('user')->get();
The capsule instance is also stored in the registry:
$this->registry->set('eloquent', EloquentDB::getCapsule()); // and in controllers $qb = $this->eloquent; $orders = $qb->table('order')->where('status',1)->get();
More information can be found in the official laravel documentation https://laravel.com/docs/12.x/queries
Характеристики
-
Recently Browsing 0 members
- No registered users viewing this page.