Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

193
Views
¿No se puede importar Excel con 2 millones de filas mysql laravel?

No puedo importar datos mysql con 2 millones de filas en este momento, solo puedo importar 8500 datos. Si tengo más de 8500, aparecerá

" 503 Servicio no disponible El servidor está temporalmente ocupado, ¡inténtalo de nuevo más tarde!"

ingrese la descripción de la imagen aquí

 <?php namespace App\Imports; use App\Models\{Datalead,Debitur,Perusahaan,Saldolist}; use Illuminate\Support\Collection; use Maatwebsite\Excel\Concerns\{ToCollection, WithHeadingRow, WithCalculatedFormulas,WithMultipleSheets }; class DataleadImportSaldolist implements ToCollection, WithHeadingRow, WithCalculatedFormulas,WithMultipleSheets { /** * @param Collection $collection */ public function sheets(): array { return [ 0 => $this, ]; } public function collection(Collection $collection) { //print("<pre>".print_r($collection,true)."</pre>"); foreach ($collection as $row) { $saldo = Saldo::create([ 'Tanggal' => $row['tanggal'], 'KodeCab' => $row['kode_cab'], 'NamaCab' => $row['nama_cab'], 'KodeKLN' =>$row['kodekln'], 'SentraKode'=> $row['sentra_code'], 'KodeKCP' => $row['kodekcp'], 'AccountType' => $row['account_type'], 'SubCategory' => $row['sub_category'], 'Produk' => $row['produk'], 'Peruntukan' => $row['peruntukan'], 'Currency' => $row['currency'], 'Kurs' => $row['kurs'], ]); } } }
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Como veo que usas un bucle foreach, tal vez sea bueno leer sobre cómo usar menos memoria en bucles sobre grandes conjuntos de datos en Laravel.

Este es un gran artículo: https://blackdeerdev.com/laravel-chunk-vs-cursor/

En resumen: la función de fragmento podría mantener bajo el uso de la memoria. También puede aumentar el tiempo máximo de ejecución de PHP

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!