Skip to content

Commit 60c9dfb

Browse files
committed
Add usage.md
1 parent 51fa5b3 commit 60c9dfb

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

docs/usage.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Usage
2+
3+
Let's assume the configuration has a runner defined as `xml` and an importer as `product` like so:
4+
5+
```php
6+
return [
7+
'importers' => [
8+
...
9+
'product' => App\Importers\ProductImporter::class
10+
...
11+
],
12+
'runners' => [
13+
...
14+
'xml' => App\Runners\XmlRunner::class
15+
...
16+
]
17+
];
18+
```
19+
20+
We can then run the import with the included `Import` facade.
21+
22+
```php
23+
// Using the key in the config
24+
\Import::runner('xml')->importer('product')->run();
25+
26+
// OR
27+
28+
// Creating new instances
29+
\Import::runner(new XmlRunner)->importer(new ProductImporter)->run();
30+
```
31+
32+
If no runner and/or importer is specified, the `default` will be used.
33+
34+
```php
35+
\Import::run();
36+
```

0 commit comments

Comments
 (0)