Answers for "pluck array in laravel"

PHP
3

pluck array in laravel

$users = User::all()->pluck('field_name');
//for keys instead of [User::all()->pluck('id');] use
$user_ids = User::all()->modelKeys();
Posted by: Guest on February-12-2021
0

pluck laravel

$name = DB::table('users')->where('name', 'John')->pluck('name');
Posted by: Guest on January-18-2021
0

laravel pluck

$users = Users::pluck('name','email');
dd($users);
Posted by: Guest on October-05-2020

Browse Popular Code Answers by Language