/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $user = User::find($id); if ($user->ownedBy($id)) { return view('user.edit')->withData($this->user->getById($id)); } \Session::flash('message', 'You do not have access to this profile!'); return redirect('home'); }