0

I get a row from my database, this row has a field 'sort'. I also wish to return the rows around this row, i.e. if sort of this row is 10, I want rows with sort 9 and 11.

Here's my eloquent:

return Products::wherePublished(1)->findOrFail($id, array('title', 'image', 'description','sort'));

Is it possible do do this with eloquent or would a regular query have to be made?

panthro
  • 21,049
  • 61
  • 166
  • 295

0 Answers0