The task is as follows: In the view you need to display the previous news. The decision to write a function in the model
public function getPrevious() { $postID = self::where('id', '<', $this->id)->max('id'); //ID return self::find($postID); } with a sample of the base. The problem when displaying in the view, you need to write there
{{$post->getPrevious()->title}} {{$post->getPrevious()->slug}} {{$post->getPrevious()->img}} It turns out 3 sql request. How to find a beautiful solution without resorting to declaring a variable in a view?