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

354
Views
Loading bulk data listing to DataTable using laravel

I'm trying to list bulk(million) data to DataTable, it takes a long time for reflecting the view page.

view JS

$.ajax({
  type:'POST',
  url: '/admin/secure/viewsupplier',
  headers: {
       'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
   },
  dataType: 'JSON',
  processData: false,
  contentType: false,
  success: function(response){

    var supplierTable = $('#supplier_table').DataTable({

    data: response,
    columns: [
       {'data':'name'},
       {'data':'email'},
       {'data':'phone'},
       {'data':'status'},
     ]

   });
  },
});

Controller

 public function viewsupplierRequest $request){
       
     $suppliers = DB::table('suppliers')->select('*')->cursor();
            
     return response()->json($suppliers);
 }

Db - PgSql

This will return 1 million supplier data for listing

I have tried get method also

    $suppliers = DB::table('suppliers')->get();

Blade

<table>
  <thead id="supplier_table">
    <tr>
      <th>Name</th>
      <th>Email</th>
      <th>Phone</th>
      <th>Status</th>
    </tr>
  </thead>
</table>
about 4 years ago · Juan Pablo Isaza
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!