I have Upgraded my laravel application php version to php 7.2 this week and from then I am facing big problems in my laravel application. before upgrading php to 7.2 every thing worked pefectly.
the main issue is about count() and array_merge() functions which is throwing this error:
for array_merge()
function the code is as below:
$array = array_merge(
$model->toSearchableArray(), $model->scoutMetadata()
);
if (empty($array)) {
return;
}
ErrorException · array_merge(): Argument #1 is not an array.
and I am facing count()
error for example at this code when the model returns no records and returns null:
count(TutorialReview::where('TutorialID', 5)->where('UserID', 6)->get())
count()
: Parameter must be an array or an object that implements Countable.
my laravel version is 5.4
now my question is how can I solve the issues, and does upgrading to laravel 5.5 solve any of the issues?