columns) throw new \Exception('ERROR: Columns must be set before calling setColumns()'); $this->_columns = collect(explode(',',strtolower($line)))->filter(); return $this->_columns->intersect($this->columns); } /** * Get the index for the column in the file * * @param string $key * @return mixed */ private function getColumnKey(string $key) { return $this->_columns->search($this->columns->get($key)); } }