/** * @param Tag $tag * @param Request $request * @return Tag * @throws \Exception */ public function update(Tag $tag, Request $request) { $owner = $this->owner($request); $tag->load(['translations']); //if the owner didn't contain the tag, we wanted to add it. if (!$owner->tags->contains($tag->id)) { $this->dispatch(new TagSomething($tag, $owner)); } $this->dispatch(new UpdateTag($tag, translation_input($request, ['name']))); return $tag; }