I'm seeding the categories table, when I run:
DB::table('cats')->insert([
'id' => 0,
'parent_cat_id' => null,
'name' => 'Uncategorized'
]);
But the inserted row's id will be 1, if I try to update the id manually on db It's possible.
Anything other than zero works in query builder (e.g. 'id'=>5)
Edit:
Currently this hack is working, what's the problem with insert() if update() can change the id to 0?
DB::table('cats')->insert([
'id' => 100,
'parent_cat_id' => null,
'name' => 'Uncategorized'
]);
DB::table('cats')->where('id',100)->update(['id' => 0]);
My migration schema:
Schema::create('cats', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->unsignedInteger('parent_cat_id')->nullable();
});