0
我使用maatwebsite導入Excel到db和INSERT忽略唯一的電子郵件laravel 5.4
$dataArray[] =
[
'name' => $row['name']
'email' => $row['email'],
];
Apprentice::insert($dataArray);
當變量打印的結果是:
array:2 [▼
0 => array:18 [▼
"name" => "Maicol Stiven"
"email" => "[email protected]"
]
1 => array:18 [▼
"name" => "Cristian Camilo"
"email" => "[email protected]"
]
]
電子郵件是一種獨特的,我需要在電子郵件重複時省略並插入其他記錄
我該怎麼辦?感謝