search

Home  >  Q&A  >  body text

php - laravel DB::table('user')->get()

DB::table()->get()方式如何得到数组而不是对象?

PHP中文网PHP中文网2817 days ago279

reply all(1)I'll reply

  • 怪我咯

    怪我咯2017-04-10 16:32:14

    试看看?

    $result = DB::table()->get();
    $result = $result->toArray();

    或者

    DB::table()->get()->toArray();

    reply
    0
  • Cancelreply