/** * Display the information for machine $id * * @param string $id * @return \Illuminate\Http\Response */ public function show($id) { // Retrieve details for a specific machine $machine = Machine::findOrFail($id); // application will return HTTP 404 if $id doesn't exist // Retrieve the active tubes for machine $id $tubes = $this->getTubes($id); // Retrieve the surveys for machine $id $surveys = TestDate::where('machine_id', $id)->orderBy('test_date', 'asc')->get(); // Retrieve the operational notes for machine $id $opNotes = $this->getOperationalNotes($id); return view('machine.detail', ['machine' => $machine, 'tubes' => $tubes, 'opnotes' => $opNotes, 'surveys' => $surveys]); }