ErrorException为foreach提供了无效的参数

时间:2018-12-31 07:48:11

标签: laravel-5

(2/2) ErrorException
Invalid argument supplied for foreach() (View: C:\laragon\www\LK\resources\views\pages\knowledgebasecategory.blade.php)

FrontController.php

public function knowledgebasecategory($id)
    {
        $knowledgebasecategory = KnowledgebaseCategory::find($id);
        $knowledgebases = Knowledgebase::orderBy('created_at','desc')->paginate(3);
        return view('pages.knowledgebasecategory')
            ->with('knowledgebasecategory', $knowledgebasecategory)
            ->with('title', $knowledgebasecategory->name)
            ->with('knowledgebasecategories', KnowledgebaseCategory::all())
            ->with('knowledgebases', $knowledgebases);
    }

knowledgebasecategory.blade.php

enter image description here

0 个答案:

没有答案