email)->first(); if (!$penghuni) { return back()->with('error', 'Data penghuni tidak ditemukan'); } $iuran = Iuran::where('penghuni_id', $penghuni->id)->get(); return view('user.iuran.index', compact('iuran')); } public function bayarQris($id) { $iuran = Iuran::findOrFail($id); $iuran->update([ 'status' => 'lunas', 'metode' => 'qris', 'tanggal_bayar' => now() ]); return response()->json([ 'success' => true ]); } // 🔥 HALAMAN UPLOAD public function upload($id) { $iuran = Iuran::findOrFail($id); return view('user.iuran.upload', compact('iuran')); } // 🔥 SIMPAN BUKTI public function storeUpload(Request $request, $id) { $request->validate([ 'bukti_pembayaran' => 'required|image|mimes:jpg,png,jpeg|max:2048' ]); $iuran = Iuran::findOrFail($id); public function status() { $penghuni = \App\Models\Penghuni::where('email', Auth::user()->email)->first(); $iuran = Iuran::where('penghuni_id', $penghuni->id)->get(); return view('user.iuran.status', compact('iuran')); } }