techboyac Posted July 12, 2019 Share Posted July 12, 2019 Hi, I still a noob in PHP programming I hope somebody in the forum can help me and give an ideas how to fixed to this problem, everytime I run localhost this message appear: ErrorException in Builder.php line 1023:count(): Parameter must be an array or an object that implements Countable But if I type localhost/(anycharacter) the page appear but with error 404(kindly refer to image, all other buttons are working except the one indicated with the arrow( kindly refer on the last image, note: app_debug set to true), this problem keeps bugging me for a few weeks now that I still cannot find a way to fixed it. Thank you in advance. ) Quote Link to comment Share on other sites More sharing options...
requinix Posted July 12, 2019 Share Posted July 12, 2019 Look at the backtrace to find what part of your code is running. Look for problems there. If you can't find the problem, post the code for the method. Quote Link to comment Share on other sites More sharing options...
techboyac Posted July 12, 2019 Author Share Posted July 12, 2019 46 minutes ago, requinix said: Look at the backtrace to find what part of your code is running. Look for problems there. If you can't find the problem, post the code for the method. Kindly check the image sir, the line where the error get stuck is highlighted, thank you https://i.postimg.cc/CKKWsqGL/New1.jpg Quote Link to comment Share on other sites More sharing options...
requinix Posted July 12, 2019 Share Posted July 12, 2019 Your code. Not Laravel. Because the problem is going to be with your code, not theirs. 1 Quote Link to comment Share on other sites More sharing options...
taquitosensei Posted July 12, 2019 Share Posted July 12, 2019 there is something wrong with $query->wheres, it's not countable. So it's not an array or not an object. Do var_dump($query->wheres); after the $query = to find out what it is and what it does contain. 1 Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 12, 2019 Share Posted July 12, 2019 The $query from $this->getQuery() does not have a valid - as of PHP 7.2 - property. Prior to PHP 7.2, the result of count() with an invalid parameter would have been misleading (a 0 or 1). Suggest verifying if this package has been updated to work with PHP 7.2. 1 Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 12, 2019 Share Posted July 12, 2019 The change is in the Github from two years ago:https://github.com/illuminate/database/commit/5dc6c29463ef5245f6e4d91501a7d8aac9d30df1 Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 12, 2019 Share Posted July 12, 2019 And this:https://github.com/illuminate/database/commit/34ae98bd9d942cbf93ff32627b0d4f093b092ba4 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.