Hi, I'm trying to associate Users with workgroups... but I keep getting error call to undefined method associate() . This are my two models and controller with store method
User can be in many work groups. Work group can contain many users.
You have 2 options to do this:
User::find($user->id)->workGroups()->save($workGroup);
or
$workGroup->groupUsers()->associate($user);
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community