/**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index($id)
 {
     $courses = Course::orderBy('name')->get();
     $return = [];
     foreach ($courses as $key => $course) {
         if ($course->college->id == $id) {
             $return[] = ["id" => $course->id, "name" => $course->name];
         }
     }
     return view('course.index')->with(['courses' => json_encode($return), 'id' => $id]);
 }
Exemplo n.º 2
0
 /**
  * Display a listing of the Course.
  *
  * @return Response
  */
 public function index()
 {
     $courseList = Course::orderBy('code', 'asc')->get();
     $active = 'course';
     return view('frontend.course.list', compact('active', 'courseList'));
 }