Laravel - get DB result without table column name

前端 未结 4 515
故里飘歌
故里飘歌 2021-01-18 19:36

I wanted to have the result with only the values not with the table column name in Laravel 4.2. For example,

$recs = DB::table(\'table_name\')
        ->s         


        
4条回答
  •  日久生厌
    2021-01-18 20:36

    DB::table('table_name')->all()->lists('id', 'title')->toArray()

    Referance: Retrieving A List Of Column Values

提交回复
热议问题