/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $version = Version::find($id); $applications = Application::lists('name', 'id'); return view('versions.edit', array('version' => $version, 'applications' => $applications)); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $person = Address::find($id); $applications_version = array(); $applications = Application::lists('name', 'id'); foreach ($applications as $id => $application) { $versions = Version::where('application_id', $id)->orderBy('id', 'desc')->get(); foreach ($versions as $id => $version) { $applications_version = array($version->id => $application . ' - ' . $version->name) + $applications_version; } } return view('persons.edit', array('person' => $person, 'applications_version' => $applications_version)); }