我试图在我的视图中找到某个列,但是我有一个错误说
“试图获取非对象属性”
你能帮帮我们吗?
这是我的控制器
$subject = Subject1::where('teacher_id', '=' , Auth::user()->id)->lists('section_name');
return View::make('teacher.view_sectionassigned')
->with('subject', $subject);
谢谢!!
答案 0 :(得分:0)
尝试遵循一个
$subject = Subject1::where('teacher_id', '=' , Auth::user()->id)->get(array('section_name'));
return View::make('teacher.view_sectionassigned')
->with('subject', $subject);