public function update($id, $name) { Assertion::string($name); $tag = $this->tags->tagOfId($id); $tag->name = $name; $tag->slug = Str::slug($name); $this->tags->update($tag); return $tag; }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $tag = $this->tagRepository->tagOfId($id); if (!$tag) { return $this->respondNotFound('Tag does not exist'); } $this->tagRepository->delete($tag); return $this->respond(['data' => $this->transform($tag)]); }