我想访问该部门的属性,以便获取那里存在的课程并将其传递给我尝试过的视图: 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);