这是来自API的数据,但我不知道如何对数据进行分页,以便在视图中显示。这是控制器的功能:-
$client =new Client();
$req = $client->request('GET','https://api.sandbox.amadeus.com/v1.2/flights/affiliate-search?apikey=lFzCNHVGO7NkDJVeUzb2ejHvIS1dIA4A&origin='.$origin.'&destination='.$destination.'&departure_date='.$dateDeparture.'&return_date='.$dateReturn.'&adults='.$adultsCount.'&children='.$ChildCount);
$data = $req->getBody()->getContents();
$flights = \GuzzleHttp\json_decode($data);
foreach ($flights->results as $flight)
{
dd($flight->deep_link);
}发布于 2017-09-19 13:00:25
也许这将帮助您按照以下步骤创建分页,您需要创建手动分页,我认为
https://stackoverflow.com/questions/46300665
复制相似问题