Getting data using the parameter from the function.

Posted 6 months ago by gouseferoz

I have two tables exam and examcategory. I am trying to fetch all exams for a particular exam_category using: public function viewTests(ExamCategory $id) { return Exams::where('exam_category',$id); //return Exams::where('exam_category', $id); }

But it is returning : Object of class Illuminate\Database\Eloquent\Builder could not be converted to string error.

can anyone help me what i am doing wrong.

Regards, Feroz.

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.