We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 491c0d5 commit 8b79537Copy full SHA for 8b79537
src/LaravelBatch.php
@@ -44,16 +44,17 @@ public function __construct(DatabaseManager $db)
44
*
45
* @return bool|int
46
*/
47
- public function update(Model $table, array $values, string $index)
+ public function update(Model $table, array $values, string $index = null)
48
{
49
$final = [];
50
$ids = [];
51
52
if (!count($values)) {
53
return false;
54
}
55
- if (!isset($index) && empty($index)) {
56
- return false;
+
+ if (!isset($index) || empty($index)) {
57
+ $index = $table->getKeyName();
58
59
60
foreach ($values as $key => $val) {
0 commit comments