How to set auto increment column as a non primary key? [Laravel Tips]

This worked for me (it’s important to set an index for the autoincrement column)

Schema::table('table', function(Blueprint $t) {
    // Add the Auto-Increment column
    $t->increments("some_colum");
 
    // auto increment needs to be an index (not necessarily primary)
    $t->index(['some_column'])

    // Remove the primary key
    $t->dropPrimary("some_column");

    // Set the actual primary key
    $t->primary(array("id"));
});

The original answer can be seen on StackOverflow