You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+89-72Lines changed: 89 additions & 72 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,44 +18,51 @@ Require this package in your composer.json and run composer update (or run `comp
18
18
19
19
**For PHP 7.4+**
20
20
21
-
"flynsarmy/csv-seeder": "2.0.*"
21
+
```json
22
+
"flynsarmy/csv-seeder": "2.0.*"
23
+
```
22
24
23
25
**For older PHP versions**
24
26
25
-
"flynsarmy/csv-seeder": "1.*"
26
-
27
+
```json
28
+
"flynsarmy/csv-seeder": "1.*"
29
+
```
27
30
28
31
### Usage
29
32
30
33
Your CSV's header row should match the DB columns you wish to import. IE to import *id* and *name* columns, your CSV should look like:
31
34
32
-
id,name
33
-
1,Foo
34
-
2,Bar
35
+
```csv
36
+
id,name
37
+
1,Foo
38
+
2,Bar
39
+
```
35
40
36
41
Seed classes must extend `Flynsarmy\CsvSeeder\CsvSeeder`, they must define the destination database table and CSV file path, and finally they must call `parent::run()` like so:
0 commit comments