public function facultyProjectChart() { $chart = []; $chart['labels'] = []; $chart['series'] = ["จำนวนโครงการ"]; $chart['data'] = []; $faculties = Faculty::with(['projects'])->get(); $seriesA = []; foreach ($faculties as $f) { array_push($chart['labels'], $f->name_th); array_push($seriesA, $f->projects->count()); } array_push($chart['data'], $seriesA); return $chart; }
public function get($id) { $faculty = Faculty::with('logo')->find($id); return $faculty; }
/** * Display the specified Faculty. * * @param int $id * @return Response */ public function show($id) { $faculty = Faculty::with('education')->find($id); return view('admin.faculty.show', compact('faculty')); }
/** * Display the specified Faculty. * * @param int $id * @return Response */ public function show($id) { $active = 'faculty'; $faculty = Faculty::with(['journal', 'conference', 'education'])->findOrFail($id); return view('frontend.faculty.show', compact('active', 'faculty')); }