I am getting data from an API, and now need to implement the bootstrap pagination, for some reasons I can't get it done.
{
"status": 200,
"data": {
"current_page": 1,
"data": [
{
"id": 1602069265173675200,
"name": "Project 1",
"description": "eerste projectje",
"created_by": 27160057,
"updated_by": null,
"deleted_by": null,
"created_at": "2020-11-04T13:49:47.000000Z",
"updated_at": "2020-11-04T13:49:47.000000Z",
"deleted_at": null,
"creator": {
"id": 27160057,
"name": "Bender Rodriguez",
"firstname": "Bender",
"initials": "B.",
"preposition": null,
"lastname": "Rodriguez",
"indienst_date": "2018-03-01 16:00:00",
"uitdienst_date": "2099-12-31 00:00:00",
"created_by": 27160057,
"updated_by": null,
"deleted_by": null,
"created_at": "2020-11-04T13:49:46.000000Z",
"updated_at": "2020-11-04T13:49:46.000000Z",
"deleted_at": null
}
},
{
"id": 1602069265173675201,
"name": "Project 2",
"description": "tweede projectje",
"created_by": 27160057,
"updated_by": null,
"deleted_by": null,
"created_at": "2020-11-04T13:49:47.000000Z",
"updated_at": "2020-11-04T13:49:47.000000Z",
"deleted_at": null,
"creator": {
"id": 27160057,
"name": "Bender Rodriguez",
"firstname": "Bender",
"initials": "B.",
"preposition": null,
"lastname": "Rodriguez",
"indienst_date": "2018-03-01 16:00:00",
"uitdienst_date": "2099-12-31 00:00:00",
"created_by": 27160057,
"updated_by": null,
"deleted_by": null,
"created_at": "2020-11-04T13:49:46.000000Z",
"updated_at": "2020-11-04T13:49:46.000000Z",
"deleted_at": null
}
},
{
"id": 1602069265173675204,
"name": "Project 3",
"description": "drie-de projectje",
"created_by": 27160057,
"updated_by": null,
"deleted_by": null,
"created_at": "2020-11-04T13:49:47.000000Z",
"updated_at": "2020-11-04T13:49:47.000000Z",
"deleted_at": null,
"creator": {
"id": 27160057,
"name": "Bender Rodriguez",
"firstname": "Bender",
"initials": "B.",
"preposition": null,
"lastname": "Rodriguez",
"indienst_date": "2018-03-01 16:00:00",
"uitdienst_date": "2099-12-31 00:00:00",
"created_by": 27160057,
"updated_by": null,
"deleted_by": null,
"created_at": "2020-11-04T13:49:46.000000Z",
"updated_at": "2020-11-04T13:49:46.000000Z",
"deleted_at": null
}
}
],
"first_page_url": "http:\/\/127.0.0.1:8000\/api\/projects?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "http:\/\/127.0.0.1:8000\/api\/projects?page=1",
"links": [
{
"url": null,
"label": "Previous",
"active": false
},
{
"url": "http:\/\/127.0.0.1:8000\/api\/projects?page=1",
"label": 1,
"active": true
},
{
"url": null,
"label": "Next",
"active": false
}
],
"next_page_url": null,
"path": "http:\/\/127.0.0.1:8000\/api\/projects",
"per_page": 50,
"prev_page_url": null,
"to": 3,
"total": 3
}
}
As you can see this Laravel API is also returning the pagiation. How to make it a pagination object so it can be used in the blade templates with $results->links()