I am new using laravel, and I got this error like this :
Call to undefined method Illuminate\Database\Query\Builder::toArray()
this is query builder in laravel
$statsMoneyInPlay = DB::table('enginepoker_log.poker')
->selectRaw("SELECT UNIX_TIMESTAMP(Date(ts)*100 as ts)")
->selectRaw("sum(pot + p1pot + p2pot + p3pot + p4pot + p5pot + p6pot + p7pot + p8pot + p9pot) / count(*) As moneyInPlay")
->groupBy("Date(ts)")
->orderBy("Date(ts)")
->toArray();