I'm using Eloquent ORM laravel 5.1, i want to return an array of ids greater than 0, My model called test
.
I have tried :
$test=test::select('id')->where('id' ,'>' ,0)->get()->toarray();
这个是二维数组
It return :
Array ( [0] => Array ( [id] => 1 ) [1] => Array ( [id] => 2 ) )
But i want result to be in simple array like :
Array ( 1,2 )
lists
method is now deprecated in 5.2. Usepluck
instead. – Fahmi Jun 27 '16 at 0:50