Gives you a global function that converts arrays to objects without removing object references. The object also implements Jsonable which will prettify the output if the object is returned (This only works in Laravel).
composer require sempro/array-to-object
$data = [
'id' => 1,
'name' => 'Test',
];
$object = arrayToObject($data);
$object->name; // 'Test'
The MIT License (MIT). Please see License File for more information.