all()); return redirect()->route('data-transaksi.index')->with('success', 'Data berhasil disimpan.'); } catch (\Exception $e) { // Tangkap pengecualian dan tampilkan pesan kesalahan return redirect()->route('data-transaksi.index')->with('error', 'Key yang anda masukkan tidak ada di saldo mon'); } } /** * Display the specified resource. */ public function show(string $id) { // } /** * Show the form for editing the specified resource. */ public function edit(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) { // } }