php - Laravel Model lists method return all the value of the column -


a model defined this:

class model extends eloquent {         protected $table='model';     } 

then query like:

$model=model::find(2); $model->id;//return 2; $model->lists('id');//return array contains ids in model table ['1','2','3',...]. not ['2']; 

so, though lists method should contains array has ids found. why has id of model table.

and class api in laravel api doc should after?

per the docs, lists function fetches list of column values table. calling in manner running brand new query.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -