PHP code example of mapyo / eloquent-only

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

    

mapyo / eloquent-only example snippets



use Mapyo\EloquentOnly\Eloquent;
$loader = > 'mysql',
        'host'     => '127.0.0.1',
        'database' => 'database',
        'username' => 'user',
        'password' => 'password',
        'port'     => 3306,
        'collation' => 'utf8_unicode_ci',
        'charset'  => 'utf8',
    )
);

class User extends Illuminate\Database\Eloquent\Model
{
    protected $table = 'users';
}

$user = User::find(1);
var_dump($user->name);

$log = Eloquent::getConnection()->getQueryLog();
var_dump($log);