ErikEklund said: return View::make('edititem')->with(compact('item', 'groups'));
You used
compact('item', 'groups')
but I don't see where is the $groups variable defined.
Stolz said:
You used
compact('item', 'groups')
but I don't see where is the $groups variable defined.
It was just an example, and the $groups variable doesn't matter to the question (declared previously, outside example code). My question was if it is intended behaviour that sync() doesn't update the object you run it on.
Yes, it's intended behaviour. Sync is only for update the pivot table.
May be what you are looking for is the method $item->push();
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community