/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $apartment = Apartment::find($id); $amenities = $apartment->amenities()->where('active', 1)->get()->lists('id', 'name')->toArray(); $photos = Apartment::photoArray($apartment->photos, $apartment->id); return view('admin.apartment.edit', ['apartment' => $apartment, 'amenities' => $amenities, 'photos' => $photos]); }