0
votes

Or is it enough to have just the relations defined in the model. I have been trying to connect tables users and groups and got only to a point where only last connection in array got saved ...

Just to add, I am using table users_groups as a join table. This table tas fields user_id and group_id. Find all works like a treat.

1

1 Answers

1
votes

All you need to do as far as your database is concerned is to make sure you're using the correct table name and field(s). Then, as long as you have your model associations set up correctly, you should be good to go.

In your case, your table should be 'groups_users', not 'users_groups' (they should be in alphabetical order).