Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

pluck array in laravel

$users = User::all()->pluck('field_name');
//for keys instead of [User::all()->pluck('id');] use
$user_ids = User::all()->modelKeys();
 
PREVIOUS NEXT
Tagged: #pluck #array #laravel
ADD COMMENT
Topic
Name
2+5 =