Skip to content

Commit 2369078

Browse files
authored
Add Example
1 parent 7d5c906 commit 2369078

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ file app.php in array aliases :
1717
`'UpdateBatch' => Mavinoo\UpdateBatch\UpdateBatchFacade::class,`
1818

1919

20-
# Example
20+
# Example 1
2121

2222
```
2323
$table = 'users';
@@ -40,3 +40,35 @@ $index = 'id';
4040
4141
UpdateBatch::updateBatch($table, $value, $index);
4242
```
43+
44+
45+
# Example 2
46+
47+
```
48+
$table = 'users';
49+
50+
$value = [
51+
[
52+
'id' => 1,
53+
'status' => 'active'
54+
],
55+
[
56+
'id' => 5,
57+
'status' => 'deactive',
58+
'nickname' => 'Ghanbari'
59+
],
60+
[
61+
'id' => 10,
62+
'status' => 'active',
63+
'date' => Carbon::now()
64+
],
65+
[
66+
'id' => 11,
67+
'username' => 'mavinoo'
68+
]
69+
];
70+
71+
$index = 'id';
72+
73+
UpdateBatch::updateBatch($table, $value, $index);
74+
```

0 commit comments

Comments
 (0)