/** * Display the specified scans by id_sensor * @param App\Sensor $idSensor [id of the sensor] * @return Collection of App\Scan */ public function showBySensor($idSensor) { $sensor = Sensor::findOrFail($idSensor); $scans = $sensor->scans; return view('scans.showBySensor', ['scans' => $scans, 'user' => Auth::user()]); }