Created
December 1, 2014 10:01
-
-
Save thewinterwind/3870ed78b2a54f835b62 to your computer and use it in GitHub Desktop.
Get next id in table using Laravel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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