File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change
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
+ ```
You can’t perform that action at this time.
0 commit comments