我有两个模型User和Role,我已经关闭了它们的时间戳,如下所示我还从两个表(users和roles)中删除了created_at和updated_at我还有一个名为role_user的第三个数据透视表,其中包含3列id、user_id和role_id
当我尝试查找用户的角色时,我总是得到未知的列role_user.created_at not found
我想通过PivotModel来管理用户和角色,就像user belongsToMany Role和role belongsToMany users一样,所以扩展了Pivot的透视模型名称PivotModel,如何与PivotModel和User建立关系,从PivotModel中获取数据,就像PivotModel with users where role_id=1一样