Eloquent active record models

Code
<?php

use Illuminate\Database\ConnectionResolver;
use 
Illuminate\Database\Connection;
use 
Illuminate\Database\Query\Grammars\MySqlGrammar;

$pdo = new PDO('mysql:dbname=eloquent;host=127.0.0.1');

$connection = new Connection($pdo);
$connection->enableQueryLog();
$connection->setQueryGrammar(new MySqlGrammar());

$resolver = new ConnectionResolver([
    
'default' => $connection,
]);

Test::setConnectionResolver($resolver);


$test Test::find(1);

echo 
$test['name'];

$test['name'] = 'newname';
if (
$test->isDirty()) {
    
dump($test->save());
}

echo 
$test['name'];
Result
foo
true

newname
Used Versions
PHP 7.1, Zend 3.0, Symfony 3.2, Laravel 5.2, PHPUnit 5.6, Doctrine 2.6