table)->insert([ 'load_id' => $loadId, 'line_number' => $lineNumber, 'institution_id' => $institutionId ]); } } /** * Delete all records associated * with the passed load id. */ public function deleteByLoadId(string $loadId): void { DB::table($this->table)->where('load_id', '=', $loadId)->delete(); } /** * Retrieve all distinct institution IDs for the given load id. */ public function getInstitutionIdsByLoadId(string $loadId): Collection { $institutionIds = DB::table($this->table) ->select('institution_id') ->distinct() ->where('load_id', '=', $loadId) ->pluck('institution_id'); return $institutionIds; } }