/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { // $categories = $this->content->meta(); $article = $this->content->edit($id, 'article'); //已经findOrFail处理,如果不存在该id资源会抛出异常,再加is_null判定无意义 //is_null($article) and abort(404); $flags = $this->flag->index(); return view('back.article.edit', ['data' => $article, 'categories' => $categories, 'flags' => $flags]); }