where([ ['test_id', '=', $test_id], ['sample_id', '=', $sample_id] ]) ->failException(false) ->find(); } public function getItemBySampleId($sample_id) { return $this->where('sample_id', '=', $sample_id)->select(); } public function saveItemByTestIdAndSampleId($test_id, $sample_id,$data) { return $this->where([ ['test_id', '=', $test_id], ['sample_id', '=', $sample_id] ]) ->save($data); } }