Answers for "pluck multiple columns laravel"

PHP
6

laravel unique multiple columns

$table->unique(['mytext', 'user_id']);
Posted by: Guest on June-10-2020
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