Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $mapps = Student_mapping::select('student_id');
- if($request->session_id) {
- $mapps = $mapps->where('session', '=', $request->session_id);
- }
- if($request->class_id) {
- $mapps = $mapps->where('class_id', '=', $request->class_id);
- if($request->group_id) {
- $mapps = $mapps->where('group_id', '=', $request->group_id);
- if($request->section_id) {
- $mapps = $mapps->where('section_id', '=', $request->section_id);
- }
- }
- }
- $mapps = $mapps->get();
- $students = [];
- foreach($mapps as $map) {
- if($map->student)
- {
- $students[] = Student::find($map->student_id);
- }
- }
Add Comment
Please, Sign In to add comment