获取上一条记录和下一条记录:
$next_record = Post::where('id', '>', $post->id)->orderBy('id')->first();
$previous_record = Post::where('id', '<', $blog->id)->orderBy('id','desc')->first();
获取上一条的ID和下一条的ID:
$next_id = Post::where('id', '>', $post->id)->min('id');
$previous_id = Post::where('id', '<', $post->id)->max('id');