So I have part of an API up and running, but am stuck on a few things. I am working with Laravel's REST controllers and am loving the ability to use methods such as Response::eloquent($query); But, in using this:
- How should I handle query parameters (e.g id=27&order_by=timestamp), if the resource that I am getting is joining several tables?
- Should I get the values from the database, and then construct an array with only the certain fields that I want to display for API access? And how would this then work with query parameters?