How can I set AUTO_INCREMENT in Laravel with Eloquent?
1 answer
You can use SQL for yourself to do this. ALTER TABLE <table_name> AUTO_INCREMENT=100000;
...
Or
Do it like here
And use an unprepared statement;
$statement = "ALTER TABLE MY_TABLE AUTO_INCREMENT = 100000;";
DB::unprepared($statement);
or
DB::update("ALTER TABLE {your table name} AUTO_INCREMENT = 100000;");
which can then be put into a migration that creates the table.
+7
source to share