Next and Prev Post Links
Find next and previous posts using current displayed post_id
$next = DB::table("posts")->where("id", ">", $post_id)->first();
$prev = DB::table("posts")->where("id", "<", $post_id)->orderBy('created_at', 'desc')->first();
Find next and previous posts using current displayed post_id
$next = DB::table("posts")->where("id", ">", $post_id)->first();
$prev = DB::table("posts")->where("id", "<", $post_id)->orderBy('created_at', 'desc')->first();
No Comments
Leave a comment Cancel