Sorting Records
Let's now work on the sorting. I'll level with ya...this is gonna be quite long and detailed...make sure you've had some ☕️☕️
We want to be able to sort according to the preference of the client. We'll make departureTime, destination, and origin sortable. Those seem like realistic choices.
Again we'll get the preferences from the query parameters and update the flights query in FlightRepository to also perform an orderBy.
Branch: https://github.com/GaryClarke/php-api-pro/tree/68-sorting-records
0 comments