laravel中查询数据结果集变为数组

在laravel中,查询数据库后,返回的对象,可以用下面的办法变为数组

$nodes = Db::table('system_node')->orderBy('sort', 'asc')->orderBy('id' ,'asc')->get()->map(function ($value) {
            return (array)$value;
        })->toArray();
原文地址:https://www.cnblogs.com/ouzhenzhou/p/7233956.html