PHP code example of agussuroyo / eloquent-wpdb

1. Go to this page and download the library: Download agussuroyo/eloquent-wpdb 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/ */

    

agussuroyo / eloquent-wpdb example snippets


$db = new \Agussuroyo\EloquentWpdb\DB();
$capsule = $db->capsule();

// query builder
$con = $capsule->getConnection();
$con->table('tableName')->get();

// model based
class ModelName extends Illuminate\Database\Eloquent\Model
{
    
}

$all = ModelName::get();
$item = ModelName::find(123);
// do another Laravel query that we want...