Skip to content

Commit 51fa5b3

Browse files
committed
Add configuration docs
1 parent ccc1a20 commit 51fa5b3

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

docs/configuration.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Configuration
2+
3+
The published configuration file (`config/importer.php`) contains 2 arrays: `importers` and `runners`.
4+
Both arrays should contain a key `default`, which is the key that will be used when no specific importer/runner is specified.
5+
6+
## Example:
7+
8+
```php
9+
return [
10+
/***********************************************************
11+
* Importers are used for defining specific import tasks
12+
* For instance, a ProductImporter could import a file with
13+
* products into a table.
14+
***********************************************************/
15+
'importers' => [
16+
'default' => App\Importers\ProductImporter::class,
17+
'user' => App\Importers\UserImporter::class
18+
],
19+
20+
/***********************************************************
21+
* Runners are used for looping through the file
22+
* The default is a CSV runner which will loop though
23+
* CSV files line-by-line. A runner uses an importer to get
24+
* import specific settings like the model class.
25+
***********************************************************/
26+
'runners' => [
27+
'default' => \Luna\Importer\Runners\CsvRunner::class
28+
'xml' => App\Runners\XmlRunner::class
29+
]
30+
];
31+
```

0 commit comments

Comments
 (0)