GeorgeW
154
2
Laravel

Associate not working

Posted 3 months ago by GeorgeW

Good Morning,

I have 2 models, User and License. License has a hasMany relationship to user and user belongsTo license.

I have a license_id column on the users table.

when trying to associate i am using the following:

Auth::user()->license()->associate($license);

This is not working, any ideas?

Please sign in or create an account to participate in this conversation.