I have a page that shows categories/main posts which when clicked will navigate to a page with sub-posts concerning the topic of the main post. The problem is, however, that when I try to use ->get() It shows the following error:
The function I use to get the information is the following (URL Shows as slug):
public function knowledge_collection($slug, Request $request){
$knowledge_post_primary = Knowledge::where('knowledge_slug', $slug)->get();
//dd($knowledge_post_primary);
$knowledge_posts = Knowledge_Post::where('parent_id', $knowledge_post_primary->id)->get();
return view('knowledge.knowledge_posts', compact('knowledge_posts', 'knowledge_post_primary'));
}
It's most likely an easy fix, but I can't seem to find it. I hope someone else can and will be able to help me :)
I've tried requesting the data in different ways and with a FindorFail(), but nothing worked up till now.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire