@KhalilurRehman of course it's being left out, your code is leaving it out...
What I don't understand is what are you trying to do accomplish with that loop? You're moving some properties from $calls and saving them as an array in $callsData
Pagination is working without use of for loop, when want to do structuring with data using for or foreach loop, pagination is being hide from response. here is my code. Pagination object is being hide when i use for loop or foreach loop.
$calls = DB::table('call') ->where('call.company_id', '=', $company_id) ->orderBy('call.created_at', 'ASC') ->paginate($perPage, array( $columns ), 'current_page', $currentPage);
$lead = new Lead();
$i = 0;
for($i=0; $i < count($calls); ++$i){
$callData = "";
$callData['id'] = $calls[$i]->id;
$callData['date'] = $calls[$i]->date;
$callData['duration'] = $calls[$i]->duration;
$callData['user_id'] = $calls[$i]->user_id;
$callData['contact_number'] = $calls[$i]->contact_number;
$callData['from_time'] = $calls[$i]->from_time;
$callData['call_type'] = $calls[$i]->call_type;
$callData['created_by'] = $calls[$i]->created_by;
$callData['created_at'] = $calls[$i]->created_at;
$callData['updated_at'] = $calls[$i]->updated_at;
$callsData[] = $callData;
}
return $callsData;
Please or to participate in this conversation.