The following tutorial column will introduce you to an iconic method added in Laravel 8. I hope it will be helpful to friends in need!
#Laravel 8 has added an iconic method that can elegantly modify the starting value of the auto-increment ID. Today Taylor Otwell officially announced this new feature on Twitter :public function up(){ Schema::create('posts', function (Blueprint $table) { $table->id()->startingValue(1200); ...
For most applications, you may not need this, but if you don't want to start counting IDs from 1, this is a convenient option.
小声bb: For example, the reserved 4-digit QQ number?
Original text: https://laravel-news.com/laravel-auto-increment
The above is the detailed content of Laravel can elegantly modify the default auto-increment ID start value!. For more information, please follow other related articles on the PHP Chinese website!