I have this migration:
Schema::create(\'provincias\', function (Blueprint $table) { $table->string(\'codigo\', 2); $table->string(\'nombre\', 5
You can also set the type of primary key:
protected $keyType = 'string'; public $incrementing = false;
Important note. You should add the second line. $incrementing = false. If you do not this, the key will be 0 after calling save() on your model.
$incrementing = false
save()