DB query builder toArray() laravel 4

前端 未结 7 1275
野性不改
野性不改 2021-02-01 13:32

I\'m trying to convert a query to an array with the method toArray() but it doesn\'t work for the query builder. Any ideas for convert it?

Example



        
7条回答
  •  遇见更好的自我
    2021-02-01 13:48

    try this one

    DB::table('user')->where('name','Jhon')->get();
    

    just remove the "=" sign . . . .because you are trying to array just the name 'jhon' . . . . . . . .I hope it's help you . .

提交回复
热议问题