How can I use the links for paginate I return in JSON Response.
This is how I return it
return response()->json(['data' => $data,
'pagination' => $data->links()]);
This is how I use it but it does not work
$('#pagination').html(response['pagination']);
This is the response in console.log(response);
{data: {…}, pagination: {…}}
data: {current_page: 1, data: Array(2), first_page_url: 'http://127.0.0.1:8000/get-orders/2?
page=1', from: 1, last_page: 6, …}
pagination: {}
[[Prototype]]: Object
This is the response in console.log(response['pagination']);
{}
[[Prototype]]: Object

