You don't need model for the pivot table, so you only need two models for this, the User model and Group model.
-
The User
hasManyGroup that he created, you can name the relation whatever you want. -
The User can be a member of some groups and also group can have some user members. So User
belongsToManyGroup and GroupbelongsToManyUser.
if your pivot table name is not using eloquent naming convention, you have to pass the pivot table name to the second parameter of belongsToMany method.