diff --git a/README.md b/README.md index a8fea18..ceb7401 100644 --- a/README.md +++ b/README.md @@ -151,7 +151,7 @@ $collection = $excel->getCollection(); The importer class is fluent, then you can also write ``` -return Importer::make('Excel')->getCollection($filepath)->getCollection(); +return Importer::make('Excel')->load($filepath)->getCollection(); ``` ### Advanced usage diff --git a/src/Importer/AbstractSpreadsheet.php b/src/Importer/AbstractSpreadsheet.php index 8a85f88..1a8aa8a 100644 --- a/src/Importer/AbstractSpreadsheet.php +++ b/src/Importer/AbstractSpreadsheet.php @@ -37,11 +37,13 @@ public function __call($name, $args) public function load($path) { $this->path = $path; + return $this; } public function setSheet($sheet) { $this->sheet = $sheet; + return $this; } public function hasHeader($hasHeaderRow) @@ -52,11 +54,13 @@ public function hasHeader($hasHeaderRow) public function setParser(ParserInterface $parser) { $this->parser = $parser; + return $this; } public function setModel(Model $model) { $this->model = $model; + return $this; } abstract public function getType();