/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit(Request $request, $slug) { $post = Post::whereSlug('slug', $slug)->first(); if (!$this->canModify($post, $request->user)) { return redirect('/')->withErrors('You do not have sufficient permissions to edit this post'); } return $view('posts.edit')->with('post', $post); }