Zucker Array in Laravel
$users = User::all()->pluck('field_name');
//for keys instead of [User::all()->pluck('id');] use
$user_ids = User::all()->modelKeys();
Code Alchemy
$users = User::all()->pluck('field_name');
//for keys instead of [User::all()->pluck('id');] use
$user_ids = User::all()->modelKeys();
$name = DB::table('users')->where('name', 'John')->pluck('name');
$users = Users::pluck('name','email');
dd($users);