Laravel

Duplicate entry for primary key in Voyager

Oct 29, 2019

While trying to save a blog post inside Voyager admin, I came across this error:

Illuminate\Database\QueryException SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY'

And the cause of this error is I recently exported the database to a new private SQL server, and most ID fields lost their "auto-increment" property in the process !
Setting those a.i. back resolves this issue.

Laravel   Voyager   primary key   error