protected function tableData($records)
    {
        return [
            'draw'            => request('draw') + 1,
            'recordsTotal'    => $this->queryHandler->getRecordsCount(),
            'recordsFiltered' => $this->queryHandler->getFilteredCount(),
            'data'            => $records->toArray(),
        ];
    }
protected function tableData($records)
    {
        return [
            'draw'            => request('draw') + 1,
            'recordsTotal'    => $this->queryHandler->getRecordsCount(),
            'recordsFiltered' => $this->queryHandler->getFilteredCount(),
            'data'            => $records->toArray(),
        ];
    }
protected function tableData ( $ records ) { return [ 'draw' => request ( 'draw' ) + 1 , 'recordsTotal' => $ this -> queryHandler -> getRecordsCount ( ) , 'recordsFiltered' => $ this -> queryHandler -> getFilteredCount ( ) , 'data' => $ records -> toArray ( ) , ] ; }
Prepares and returns data for the datatables.

@param \Illuminate\Support\Collection Records of the table

@return array
Prepares and returns data for the datatables .