close

count() parameter must be an array or an object that implements countable in laravel

Hello Guys, How are you all? Hope You all Are Fine. Today we are talking about count() parameter must be an array or an object that implements countable in laravel php. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How count() parameter must be an array or an object that implements countable in laravel Error Occurs?

Today we are talking about count() parameter must be an array or an object that implements countable in laravel php.

How To Solve count() parameter must be an array or an object that implements countable in laravel Error ?

  1. How To Solve count() parameter must be an array or an object that implements countable in laravel Error ?

    To Solve count() parameter must be an array or an object that implements countable in laravel Error This is a documented change in PHP 7.2. You need to either update Laravel to 5.6 or downgrade PHP to version 7.1.

  2. count() parameter must be an array or an object that implements countable in laravel

    To Solve count() parameter must be an array or an object that implements countable in laravel Error This is a documented change in PHP 7.2. You need to either update Laravel to 5.6 or downgrade PHP to version 7.1.

Solution 1

Put this code at the beginning of your route file, it will work fine

if(version_compare(PHP_VERSION, '7.2.0', '>=')) {
    error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING);
}

Solution 2

This is a documented change in PHP 7.2. You need to either update Laravel to 5.6 or downgrade PHP to version 7.1.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read

Leave a Comment