【问题标题】:Laravel error count(): Parameter must an array or an object that implements Countable (Solution)Laravel error count(): Parameter must an array or an object that implements Countable (解决方法)
【发布时间】:2023-01-26 14:21:49
【问题描述】:

Laravel error count(): Parameter must an array or an object that implements Countable (解决方法) 在 laravel 中我收到了这个错误

在您的控制器文件中添加以下代码。

【问题讨论】:

    标签: php count laravel-8


    【解决方案1】:

    将此添加到您的控制器文件中,问题将得到解决。将 php 版本更改为您的 php 版本

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

    【讨论】:

      猜你喜欢
      • 2018-11-01
      • 2020-11-02
      • 1970-01-01
      • 1970-01-01
      • 2021-10-06
      • 2019-03-11
      • 1970-01-01
      • 2018-12-19
      • 1970-01-01
      相关资源
      最近更新 更多