laravel migration with primary key code example Example: laravel migration with primary key $table->string('code', 30)->primary();