Search code examples
phplaravel-4pluck

How to get all the values of single column using laravel 4.2


I am using pluck method to get data from single column

$systems = OptionUser::pluck('user_skill');

This systems variable returning only one value while I have around 50 values in this table. Please suggest what is correct way to get all the data from this column.


Solution

  • please use get (which returns simple array of stdObjects) instead of pluck (which returns single value - string by default) in laravel 5.4, because of pluck only gives single value from database

    $systems = OptionUser::select('user_skill')->get();