laravel pluck multiple columns same in php array code example
Example 1: eloquent pluck multiple columns
$records = $records->pluck('data', 'id')->toArray();
// [
// 'id' => 'data',
// ...
//]
Example 2: laravel pluck multiple columns
YourModelName::all('id', 'name');