Call to a member function count() on a non-object (Laravel 5)

后端 未结 3 1427
抹茶落季
抹茶落季 2021-02-15 10:14

I have a list of projects, where I can click on and it (needs to) show the project name, and the list of the projects\' tasks (ToDo application)

But when I click on a ce

3条回答
  •  既然无缘
    2021-02-15 11:09

    $project->tasks is an array and you cant call count() on the array. So try with -

    count($project->tasks)
    

提交回复
热议问题