working on importing mailing list with filtering email which is unique and validate i tried with "validator" but its not working
public static function import($dto,$file){
$path = $file->getRealPath();
$data = \Excel::load($path)->get();
foreach($data->toArray() as $key => $value){
foreach($value as $row){
if(Validator::make(['email' => $row], [
'email' => 'required|email'])){
$insert_data = Mail::create(array(
'name' => $row['name'],
'email' => $row['email']
));
$insert_data->GroupMAil()->attach($dto>group_name);
}
}
}
}
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2NuLC3p
via IFTTT
Aucun commentaire:
Enregistrer un commentaire