title: How to create pagination on return json data in laravel
body: <p>This is data that comes from API but i don't know how to paginate that data so i can display it on view. 
  This is the Controller function:-   </p>
  
  <pre><code>    $client =new Client();
  
      $req = $client-&gt;request('GET','https://api.sandbox.amadeus.com/v1.2/flights/affiliate-search?apikey=lFzCNHVGO7NkDJVeUzb2ejHvIS1dIA4A&amp;origin='.$origin.'&amp;destination='.$destination.'&amp;departure_date='.$dateDeparture.'&amp;return_date='.$dateReturn.'&amp;adults='.$adultsCount.'&amp;children='.$ChildCount);
  
      $data = $req-&gt;getBody()-&gt;getContents();
  
      $flights = \GuzzleHttp\json_decode($data);
  
      foreach ($flights-&gt;results as $flight)
      {
              dd($flight-&gt;deep_link);        
      }
  </code></pre>