Add /api/airports with pagination to return all the airports #120

This commit is contained in:
Nabeel Shahzad
2018-01-05 10:23:26 -06:00
parent e04fa2e056
commit e931310dee
6 changed files with 52 additions and 3 deletions

View File

@@ -19,6 +19,15 @@ class AirportController extends AppBaseController
$this->airportRepo = $airportRepo;
}
/**
* Return all the airports, paginated
*/
public function index()
{
$airports = $this->airportRepo->orderBy('icao', 'asc')->paginate(50);
return AirportResource::collection($airports);
}
/**
* Do a lookup, via vaCentral, for the airport information
* @param $id