Laravel: 试图获得一个 属性 的非对象
Laravel: Trying to get a property of non-object
我试图在我的视图中获取某个列,但我遇到错误
"Trying to get a property of non-object"
你们能帮帮我吗?
这是我的控制器
$subject = Subject1::where('teacher_id', '=' , Auth::user()->id)->lists('section_name');
return View::make('teacher.view_sectionassigned')
->with('subject', $subject);
谢谢!!
尝试关注一个
$subject = Subject1::where('teacher_id', '=' , Auth::user()->id)->get(array('section_name'));
return View::make('teacher.view_sectionassigned')
->with('subject', $subject);
我试图在我的视图中获取某个列,但我遇到错误
"Trying to get a property of non-object"
你们能帮帮我吗?
这是我的控制器
$subject = Subject1::where('teacher_id', '=' , Auth::user()->id)->lists('section_name');
return View::make('teacher.view_sectionassigned')
->with('subject', $subject);
谢谢!!
尝试关注一个
$subject = Subject1::where('teacher_id', '=' , Auth::user()->id)->get(array('section_name'));
return View::make('teacher.view_sectionassigned')
->with('subject', $subject);