/** * Show the form for editing the specified resource. * * @param int $id * * @return \Illuminate\Http\Response */ public function edit($id) { /* * Returns the specified resource 'with' all of its * relationships */ $work = Work::with('agency', 'photos')->findOrFail($id); // Pass in agencies to view $agencies = Agency::lists('name', 'id'); return view('dashboard.works.edit', ['work' => $work, 'agencies' => $agencies]); }