A little background information
I am using AngularJS as a frontend framework and Laravel for an API for the front end to communicate with.
The problem
For this app I have a 'section' which has a next/prev button in the view, when the next is clicked, an API call is made with the current section ID as a parameter. From this I was hoping to get hold of the next or previous item in the array depending on the endpoint I use (which button was clicked).
How would I go about this in PHP/Laravel, is it possible or should I be re thinking about the structure of my app/api?
What I have now
So at the moment, I all I have is a 'Section' collection:
$sections = Section::orderBy('order', 'DESC')->orderBy('id', 'ASC')->get();
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire