Level 2
This is a good example of the Load More button https://www.themoviedb.org/list/9883
The Movie DB database has a route to get the movies in a list. It returns 20 items at a time and the user has the option to include a query string designating the page number
https://www.themoviedb.org/list/8434?page=2
My routes look like this
Route::get('/list/{id}', 'MoviesController@list')->name('movies.list');
Route::get('/list/{id}/{page}', 'MoviesController@list')->name('movies.list');
and in my controller
public function list($id, $page = 1)
{
$list = Http::withToken(config('services.tmdb.token'))
->get('https://api.themoviedb.org/4/list/'.$id.'?page='.$page)
->json();
ddd($list);
}
How would you paginate this and would it be easier to have a Load More button at the bottom to append to the list of movies in the same page without having to reload a page? (The Movie DB does handle it that way)
Please or to participate in this conversation.