3

What I've understand so far is that many to many table naming conventions for Laravel are:

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? Is attribute_composed_attribute going to work? If so what is the proper name for the second table in order to work?

Appreciate your kind help.

Jocky Doe
  • 2,041
  • 4
  • 17
  • 28

1 Answers1

2

It will be 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/

Alexey Mezenin
  • 158,981
  • 26
  • 290
  • 279