- I made this just for personal use
- I do not guarantee anything for the use of this software
- Do It With Your Own Risk
Using composer
composer require agussuroyo/eloquent-wpdb
Boot it first
$db = new \Agussuroyo\EloquentWpdb\DB();
$capsule = $db->capsule();
then do manual query builder
// query builder
$con = $capsule->getConnection();
$con->table('tableName')->get();
or model based query
// model based
class ModelName extends Illuminate\Database\Eloquent\Model
{
}
$all = ModelName::get();
$item = ModelName::find(123);
// do another Laravel query that we want...