public function editStudentSection(Request $request) { $user = Auth::User(); $sectionsArray = Section::getAllSections(); // dd($sectionsArray); /* $sectionsArray = array(); $i = 0; foreach($sections as $section){ $sectionsArray[$i]['id'] = $section->id; $sectionsArray[$i]['grade'] = $section->grade; $sectionsArray[$i]['order'] = $section->order; $sectionsArray[$i]['total'] = $section->total; $school = School::find($section->schools_id); $sectionsArray[$i]['schoolId'] = $school->id; $sectionsArray[$i]['schoolName'] = $school->name; }*/ // $sectionsArrayPaginator = new Paginator($sectionsArray, 5); return view('section.studentChooseSection', compact('user', 'sectionsArray')); }