search

Home  >  Q&A  >  body text

Put the classification table information in $result. When the final result is returned, it is converted into a two-dimensional array. Collection::make reported an error. The collection method does not exist.

foreach ($res as $k => $v) {

 $cate_name     = '|--' . $v->cate_name;  

$v->$cate_name = str_repeat(' ', $blank) . $cate_name; $result[] = $v;self::getCate($v->id, $result, $blank); 

 return Collection::make($result)->toArray();报错内容 :collection方法不存在


赞赞.赞赞.2166 days ago1226

reply all(1)I'll reply

  • 移动用户-3906076

    移动用户-39060762019-11-27 15:07:55

    I also encountered this problem, I don’t know how to solve it? Fatal error: Class 'app\admin\model\Collection' not found in E:\PHPWAMP_IN3\wwwroot\qiye\application\admin\model\Category.php on line 39

    reply
    0
  • Cancelreply