コード例 #1
0
ファイル: HomeController.php プロジェクト: alfrcr/ilearn
 public function index()
 {
     $classroomIds = Auth::user()->joinedClassrooms;
     $activities = Activity::whereIn('classroom_id', $classroomIds)->orderBy('created_at', 'DESC')->paginate(10);
     $discussions = Discussion::where('parent_id', '')->whereIn('classroom_id', $classroomIds)->orderBy('created_at', 'DESC')->paginate(10);
     return view('user.global.feeds', compact('activities', 'discussions'));
 }