There are two methods for getting the next auto_increment ID from MySQL. Both of these examples are using Laravel. Please note that this method, non-blocking, opens the door for a "race condition" in the sense that one person could get the next ID, pause for a moment, and then another request gets the same ID (since it hasn't been incremented yet) leading to a situation in which two requests both have the same ID reserved.
\DB::select('SELECT AUTO_INCREMENT as "id"