/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id, Request $request) { $data['request'] = $request; $data['incident'] = ITP::findOrFail($id); $data['reportingOrgs'] = ITP::select('ReportingOrg')->where('Date', '>=', '2015-01-01')->distinct()->orderBy('ReportingOrg')->get(); $data['buildings'] = ITP::select('Building')->where('Date', '>=', '2015-01-01')->distinct()->orderBy('Building')->get(); $data['ImpactDescriptions'] = ITP::select('ImpactDescription')->where('Date', '>=', '2015-01-01')->distinct()->orderBy('ImpactDescription')->get(); $data['IncidentLevels'] = ITP::select('IncidentLevel')->where('Date', '>=', '2015-01-01')->distinct()->orderBy('IncidentLevel')->get(); $data['Sections'] = ITP::select('Section')->where('Date', '>=', '2015-01-01')->distinct()->orderBy('Section')->get(); $data['IncidentOwner'] = ITP::select('IncidentOwner')->where('Date', '>=', '2015-01-01')->distinct()->orderBy('IncidentOwner')->get(); $data['Engineers'] = ITP::select('Engineer')->where('Date', '>=', '2015-01-01')->distinct()->orderBy('Engineer')->get(); $data['RootCauses'] = ITP::select('RootCause')->where('Date', '>=', '2015-01-01')->distinct()->orderBy('RootCause')->get(); $data['IncidentStatus'] = ITP::select('IncidentStatus')->where('Date', '>=', '2015-01-01')->distinct()->orderBy('IncidentStatus')->get(); return view('incident.edit.edit', $data); }