public function createQuestion() { $action = 'forum'; $cates = Cate::all(); return view('member.forum.create-question', compact('action', 'cates')); }
public function edit($id) { $getCate = Cate::all(); $cates = array(); foreach ($getCate as $k => $v) { $cates[$v->id] = $v->name; } $article = Article::findOrFail($id); $tags = Tag::where(['user_id' => \Auth::user()->id, 'article_id' => $id])->get(); $tagsString = ''; foreach ($tags as $k => $v) { $tagsString = $tagsString . $v->tag . ','; } $tagsString = substr($tagsString, 0, strlen($tagsString) - 1); return view('member.articles.edit', compact('article', 'tagsString', 'cates')); }