Level 75
Use collection then paginate https://laracasts.com/discuss/channels/guides/paginate-collection-simple-example-guide
Also if putting results into a database table, just paginate the normal way.
1 like
Those results are from an Api
current_page 1
data
0
Rank 1
Status "Recruiting"
NCTId "NCT04682574"
Organization "University of Lahore"
Sponsor "University of Lahore"
1
Rank 2
Status "Not yet recruiting"
NCTId "NCT04682561"
Organization "St. Michael's Hospital, Toronto"
Sponsor "St. Michael's Hospital, Toronto"
first_page_url "http://localhost:8888/clinical-trials?page=1"
from 1
last_page 5
last_page_url "http://localhost:8888/clinical-trials?page=5"
next_page_url "http://localhost:8888/clinical-trials?page=2"
path "http://localhost:8888/clinical-trials"
per_page 2
prev_page_url null
to 2
total 10
and in the controller
$fullStudies = $trialsApiService->fullStudies()->paginate(2);
Please or to participate in this conversation.