Laravel获取对象的属性

时间:2018-06-26 18:56:10

标签: php laravel

我想访问该部门的属性,以便获取那里存在的课程并将其传递给我尝试过的视图: dd($ department-> id),但不在仅在视图中工作的控制器中

$department = Student::where('students.id', Auth::user()->id)
                ->join('departments', 'department_id', 'departments.id')
                ->select('departments.id', 'departments.nom')
                ->get();
                //dd($department);

0 个答案:

没有答案