Ejemplo n.º 1
0
 public static function upload()
 {
     $uploadPath = storage_path('temp') . "/" . basename($_FILES['file']['name']);
     if (!move_uploaded_file($_FILES['file']['tmp_name'], $uploadPath)) {
         return null;
     }
     $csvUsers = CsvFileService::csvToArray($uploadPath);
     foreach ($csvUsers as $csvUser) {
         self::updateEmailAndPassword($csvUser[0], $csvUser[3], $csvUser[4]);
     }
     unlink($uploadPath);
     return "success";
 }
Ejemplo n.º 2
0
 public static function upload()
 {
     $uploadPath = storage_path('temp') . "/" . basename($_FILES['file']['name']);
     if (!move_uploaded_file($_FILES['file']['tmp_name'], $uploadPath)) {
         return null;
     }
     $payeePayments = CsvFileService::csvToArray($uploadPath);
     foreach ($payeePayments as $payeePayment) {
         self::updateOrCreatePayeePayment($payeePayment);
     }
     unlink($uploadPath);
     return "success";
 }