It seems like there is no sync()
function for morph tables on Laravel.
I have two tables avails
and questions
. questions
is a morphMany
table. I want to use the sync command, and this is what I did:
Avail::find($id)->questions()->sync($some_ids);
This gives me the following error:
Call to undefined method Illuminate\Database\Query\Builder::sync()
So is there a way to get sync
to work or am I just not doing this right?