Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Get next id in table using Laravel
<?php
// select min(id) as id from `property` where `id` > 1;
DB::table($table)->select(DB::raw('min(id) as id'))->where('id', '>', $id)->id;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment