samedi 8 juin 2019

Increase number of created records with eloquent ::create

I have a simple csv file upload to laravel 5 backend and mysql, It's creating new records in the table with autoincrement id and value, the problem is that the uploaded file has about 10k records and i need to have them all in my db. With my current set up I can go max to 1000 records, how can I increse it ?

while ($columns = fgetcsv($file)) {
        // if ($columns[0] === "Brno") {
        //     continue;
        // }
        foreach ($columns as $key => &$value) {
            $value = preg_replace('/[^ a-zA-Z0-9 *]/', '', $value);
        }
        $data = array_combine($escaptdHeader, $columns);

        foreach ($data as $key => &$value) {
            $value = ($key == 'visa') ? (string)$value : 
             (string)$value;
        }
        $visa = $data['visa'];

        $budget = VisaStatus::create(['visa' => 
          $visa]);
        $budget->visa = $visa;
        $budget->save();
     }



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire