简体   繁体   English

多对多的命名约定

[英]Many to many naming conventions

What I've understand so far is that many to many table naming conventions for Laravel are: 到目前为止我所理解的是Laravel的多对多表命名约定是:

users & privileges = user_privilege

But what is the case with more complex names like: 但更复杂的名称是什么情况,如:

attributes & composed_attributes = ?

As you can see there is a underscore symbol in the second table. 如您所见,第二个表中有一个下划线符号。 Is that underscore in the way of Laravel recognizing the pivot by default? 这是Laravel默认识别枢轴的方式吗? Is attribute_composed_attribute going to work? attribute_composed_attribute会起作用吗? If so what is the proper name for the second table in order to work? 如果是这样,为了工作,第二个表的正确名称是什么?

Appreciate your kind help. 感谢您的帮助。

It will be attribute_composed_attribute . 它将是attribute_composed_attribute

Name of the pivot table should consist of singular names of both tables, separated by undescore symbole and these names should be arranged in alphabetical order 数据透视表的名称应由两个表的单数名称组成,由非核心符号分隔,这些名称应按字母顺序排列

http://laraveldaily.com/pivot-tables-and-many-to-many-relationships/ http://laraveldaily.com/pivot-tables-and-many-to-many-relationships/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM