public function getById($id) { $tag = $this->model->find($id); if (!is_null($tag)) { $tag->hot++; $tag->update(); } return $tag; }
/** * Redirect to tags with default tag. * * @param $id * @return \Illuminate\Http\RedirectResponse */ public function showTag($id) { $tag = $this->tag->getById($id); return redirect('/tags')->with('default', $tag); }