Problem Duplicate entry in assignRole #1790
-
Hello But the problem is that when assigning a new role, I encounter the following error:
Thank you for your guidance on how to create a role-based system for different organizations using this package. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You have to change the composite primary key, adding your new ids $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 |
Beta Was this translation helpful? Give feedback.
You have to change the composite primary key, adding your new ids
laravel-permission/database/migrations/create_permission_tables.php.stub
Lines 69 to 70 in 7711587
Also, #1782 can help you