/** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, Studio $studio, Event $event) { $event->update($this->prepare($request, $studio)); $event->pieces()->sync($this->prepareTags($request, 'piece_list')); $event->categories()->sync($this->prepareTags($request, 'category_list')); return redirect()->action('Admin\\StudioEventsController@show', [$studio->id, $event->id]); }
/** * Sync Event's Pieces * * @param Event $event * @param array $pieces * @return void */ public function syncPieces(Event $event, array $pieces) { $event->pieces()->sync($pieces); }