SoftDeletingScope.php line 55: count(): Parameter must be... 报错的解决方法

Spoony 57.25m2023-08-10283 次点击
This shouldn't be affecting 5.5 for what I've tested. We have tests for soft deleting feature (e.g. DatabaseSoftDeletingScopeTest and DatabaseSoftDeletingTraitTest) and the Continuous Integration builds for PHP 7.2 aren't failing:

Note that this same line of SoftDeletingScope has already been fixed: Going back in time we can see that this was fixed in 5.4 after merging PR #20258. 😉


I solved by changing "$originalWhereCount = count($query->wheres);" for "$originalWhereCount = is_null($query->wheres)
? 0 : count($query->wheres);" in the function "callScope(callable $scope, $parameters = [])" in the file "/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php"
收藏 ♥ 感谢

登录注册 后可回复。