title: How to paginate with return as json laravel
body: <p>I want to create a pagination with return as json, but I'm getting an error like below</p>
  
  <blockquote>
    <p>ErrorException in Macroable.php line 74:
    Method links does not exist.</p>
  </blockquote>
  
  <p>here my controller code</p>
  
  <pre><code> public function getcustomer($id){
  
      $customer = Customer::find($id)-&gt;paginate(5);
  
      return response()-&gt;json([$customer], 200);
  }
  </code></pre>
  
  <p>and here my blade code</p>
  
  <pre><code>{{$customer-&gt;links('vendor.pagination.pagination')}}
  </code></pre>
  
  <p>how can I create a pagination with json response() ?</p>