The pagination in Laravel uses yajra datatable when the number of records is large

Tram Ho

Các bạn cho mình hỏi cách để chia nhỏ dữ liệu trong yajra datatable để tải lên trình duyệt khi số lượng bản ghi lớn.
Code Controller
public function index()
{
if(request()->ajax())
{
$item = Monhoc::select([‘id’,’name’])->orderBy(‘id’, ‘desc’);
return Datatables::of($item)
->addColumn(‘action’, function($item){


**** Code view:****
$(document).ready(function() {
// Load data
$(‘ #monhoc_table’).DataTable( {
processing: true,
serverSide: true,
ajax: ‘{{ route(‘monhoc.index’) }}’,
Share the news now

Source : Viblo