我想一次更新多行。我将数组修改如下:
Array
(
[0] => Array
(
[id] => 13
[up] => 1
[down] => 2
[status] => 1
)
[1] => Array
(
[id] => 14
[up] => 1
[down] => 3
[status] => 1
)
[2] => Array
(
[id] => 15
[up] => 1
[down] => 4
[status] => 1
)
)
此数组分配给$ update变量。并尝试更新如下:
$hierarchyInstance = new Hierarchy;
Batch::update($hierarchyInstance, $update, 'id');
但是我收到致命错误。我的方法有什么问题?
我正在使用laravel 5.7。提前致谢。