Skip to content

Problem Duplicate entry in assignRole #1790

Answered by erikn69
BehroozBvk asked this question in Q&A
Discussion options

You must be logged in to vote

You have to change the composite primary key, adding your new ids

$table->primary(['role_id', $columnNames['model_morph_key'], 'model_type'],
'model_has_roles_role_model_type_primary');

$table->primary(['role_id', $columnNames['model_morph_key'], 'model_type','organization_id','organizer_id','others....'], 
        'model_has_roles_role_model_type_primary'); 

Also, #1782 can help you

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@BehroozBvk
Comment options

Answer selected by drbyte
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants