agussuroyo/eloquent-wpdb

$wpdb that wrapped with Eloquent from Laravel

dev-main 2023-09-08 16:40 UTC

This package is auto-updated.

Last update: 2024-12-08 19:46:51 UTC


README

PHP Validator

  • I made this just for personal use
  • I do not guarantee anything for the use of this software
  • Do It With Your Own Risk

Installation

Using composer

composer require agussuroyo/eloquent-wpdb

Usage

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...