Exemplo n.º 1
0
 /**
  * @desc show list of terms per year
  * @param Year $year int to load terms
  * @param Department $department fro breadcrumbs
  **/
 public function index(Year $year, Department $department, Faculty $faculty)
 {
     $year->load('terms');
     $terms = Term::where('year_id', $year->id)->select('academystructure_terms.*')->selectRaw('COUNT(sh.id) as total_students')->leftJoin('academystructure_departments as acadep', 'acadep.term_id', '=', 'academystructure_terms.id')->Leftjoin('student_histories as sh', 'sh.academystructure_department_id', '=', 'acadep.id')->groupBy('academystructure_terms.id')->get();
     $breadcrumbs = $faculty->breadcrumbs()->where('ay.id', '=', $year->id)->first();
     return view('academystructure::terms.index', compact('terms', 'year', 'breadcrumbs'));
 }
Exemplo n.º 2
0
 /**
  * @desc show list of terms per year
  * @param Year $year int to load terms 
  * @param Department $department fro breadcrumbs
  **/
 public function index(Year $year, Department $department, Faculty $faculty)
 {
     $year->load('terms');
     $terms = $year->terms;
     $breadcrumbs = $faculty->breadcrumbs()->where('ay.id', '=', $year->id)->first();
     //dd($breadcrumbs);
     return view('academystructure::terms.index', compact('terms', 'year', 'breadcrumbs'));
 }