Problems linking view and controller
问题 This is the error I am getting on the sample view: Undefined variable: sampleRecord This is the controller code: public function show($sample_id) { return View::make('samples.show')->with([ $this->sampleRepository->find($sample_id), $this->sampleRecord->getSamplePartNumberRecord, ]); } This is the view code: <p>{{ $sampleRecord }}</p> @foreach($sampleRecord->SamplePartNumbers() as $samplePartNumberRecord) <p>Sample Part Number: <br />{{ $samplePartNumberRecord }}</p> @endforeach 回答1: your