groupBy('year')->pluck('year'); $tahun = $request->tahun; // Tangani filter tahun $seminarProposals = SeminarProposal::whereIn(SeminarProposal::raw('YEAR(created_at)'), $tahuns) ->when($tahun, function ($query, $tahun) { return $query->whereYear('created_at', $tahun); }) ->with(['mahasiswa', 'pengajuan.dosenPembimbing']); $seminarProposals = $seminarProposals->get(); // Mengembalikan view dengan data seminar proposal return view('peserta-sempro', compact('no', 'tahun', 'tahuns', 'seminarProposals')); } /** * Store a newly created resource in storage. */ public function store(Request $request) { // } /** * Display the specified resource. */ public function show(string $id) { // } /** * Update the specified resource in storage. */ public function update(Request $request, string $id) { // } /** * Remove the specified resource from storage. */ public function destroy(string $id) { // } }