I think i should pass referredProcedureBookings to links. {{ referredProcedureBookings->links() }}
Jun 14, 2018
2
Level 1
Pagination for the view is not working in laravel5.3
I am trying to use pagination for my view pages but getting error as : Call to a member function links() on array
Limiting to display records using paginate in controller is fine,but issue is when passing to the view. Controller code is:
$referredProcedureBookings = Gateway::procedurebooking()->getReferredProcedureBooking()->paginate(5);
$new_records = [];
foreach ($referredProcedureBookings as $referredProcedureBooking)
{
$records['ProcedureId'] = $referredProcedureBooking->id;
$records['ProcedureName'] = $referredProcedureBooking->procedure_name;
$new_records[] = $records;
}
return view('procedurebookings',compact('new_records');
In my view its like this:
@foreach($new_records as $new_recordss)
<td><div class="col-md-2"><h5 class="panel-body">{{ $new_recordss['Name'] }}</h5></div></td>
<td><div class="col-md-2 col-md-pull-6"><h5 class="panel-body">{{ $new_recordss['Age'] }}</h5></div></td>
@endforeach
{{ $new_records->links() }}
error i am getting is :Call to a member function links() on array
Even if i use :{{ $new_records[links()] }}
then i get :Call to undefined function links()
how should i use the links method?
Level 1
1 like
Please or to participate in this conversation.