我使用UUID作为所有表的主键.当我将角色分配给用户时,请返回以下内容
错误:
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a c hild row: a foreign key constraint fails (
leave_management.
model_has_roles, CONSTRAINT
model_has_roles_role_id_foreign FOREIGN KEY (
role_id) REFERENCES
roles (
id) ON DELETE CASCADE) (SQL: insert into
model_has_roles (
model_id
,
型号类型,
角色_id) values (17a97eae-45c8-49b4-9985-453e2e2d50be, App\Models\User, 0))
用户和角色具有密钥,但错误相同.
角色表截图link.
用户表屏幕截图link