public function index(Request $request) { $start = $request->input('start', 0); $length = $request->input('length', 5); $draw = $request->input('draw', 1); $total = AppWeb::count(); $appWeb = AppWeb::skip($start)->take($length)->orderBy('id'); echo json_encode(array("draw" => intval($draw), "recordsTotal" => intval($total), "recordsFiltered" => intval($total), "data" => $appWeb->get()->toArray())); }