middleware('auth'); } /** * Show the application dashboard. * * @return \Illuminate\Contracts\Support\Renderable */ public function index() { $courses = Course::all(); $takeCourseIds = StudentCourse::where(["user_id" => Auth::user()->id])->pluck("course_id")->toArray(); return view('home', ['courses' => $courses, "take_ids" => $takeCourseIds]); } }