/** * Display a listing of the resource. * * @return Response */ public function index() { // List all the active specimentypes $specimentypes = SpecimenType::orderBy('name', 'ASC')->get(); // Load the view and pass the specimentypes return view('specimentype.index', compact('specimentypes')); }
public function specimenCountPerStatus() { $this->withoutMiddleware(); $this->call('POST', '/specimentype', $this->specimenData); $specimenTypeStored = SpecimenType::orderBy('id', 'desc')->first(); $specimenTypeSaved = SpecimenType::find($specimenTypeStored->id); $count = $specimenTypeSaved->countPerStatus([Specimen::ACCEPTED, Specimen::REJECTED, Specimen::NOT_COLLECTED]); $this->assertEquals($specimenTypeSaved->specimen->count(), $count); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { //Get the testtype $testtype = TestType::find($id); $measures = Measure::all(); $measuretype = MeasureType::all()->sortBy('id'); $specimentypes = SpecimenType::orderBy('name')->get(); $testcategory = $testtype->testCategory->id; $testcategories = TestCategory::lists('name', 'id'); $organisms = Organism::orderBy('name')->get(); //Open the Edit View and pass to it the $testtype return view('testtype.edit', compact('testtype', 'testcategories', 'testcategory', 'measures', 'measuretype', 'specimentypes', 'organisms')); }