Reputation: 295
I have a problem with my Many to Many relation:
I have two tables related with many to many relation
and the association table
My problem is how to add these extra fields. I don't know how to configure the model of the two entities.
Please, can someone help me with this? Thanks
Upvotes: 0
Views: 254
Reputation: 4522
You need to change your relations. As stated in the docs, the relations transform to
Table1 hasMany Table1_Table2
Table1_Table2 belongsTo Table1, Table2
Table2 hasMany Table1_Table2
Then you need to create a model Table1_Table2 in your model folder and treat it like any other belogsTo-hasMany association, but you can add more fields (and validation if you want).
Upvotes: 1