laravel query array code example
Example 1: DB::table('users')->get(); id 1
$users = DB::table('users')where('id','=', $userid)->get();
Example 2: laravel get query result as array
$result = array_map(function ($value) {
return (array)$value;
}, $result);