Eloquent get only one column as an array

前端 未结 5 2054
时光说笑
时光说笑 2020-12-08 01:39

How to get only one column as one dimentional array in laravel 5.2 using eloquent?

I have tried:

$array = Word_relation::select(\'word_two\')->wh         


        
5条回答
  •  时光说笑
    2020-12-08 02:05

    I think you can achieve it by using the below code

    Model::get(['ColumnName'])->toArray();

提交回复
热议问题