Answers for "laravel pluck multiple columns"

PHP
1

eloquent pluck multiple columns

$records = $records->pluck('data', 'id')->toArray();
// [
//	'id' => 'data',
//  ...
//]
Posted by: Guest on March-16-2021
0

laravel pluck multiple columns

YourModelName::all('id', 'name');
Posted by: Guest on March-01-2021

Browse Popular Code Answers by Language