/** * Index grades of a specific user. * * @param User $user * @return \Illuminate\Http\Response */ public function show(User $user) { $this->authorize('userProfile', $user); $grades = $user->grades; $quizzes = $user->quizzes()->withPivot('attempt')->orderBy('name', 'asc')->orderBy('pivot_attempt', 'asc')->get(); $evaluations = Evaluation::all(); return view('users.show', ['grades' => $grades, 'quizzes' => $quizzes, 'evaluations' => $evaluations, 'user' => $user]); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $evaluations = Evaluation::all(); $total = 0; foreach ($evaluations as $evaluation) { $total += $evaluation->grade; } return view('evaluation.index', ['evaluations' => $evaluations, 'total' => $total]); }
/** * Display the home page. * * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ public function home() { $evaluations = Evaluation::all(); return view('pages.home', ['evaluations' => $evaluations]); }
public function overview() { $evaluations = Evaluation::all(); return view('admin.overview', ['evaluations' => $evaluations]); }