solve lahan & tanaman

This commit is contained in:
2026-07-22 11:58:51 +07:00
parent 12f8d0bbda
commit e02a34a527
4 changed files with 11 additions and 11 deletions
@@ -178,7 +178,7 @@ class PetaniController extends Controller
'created_by' => auth()->id(),
'updated_by' => auth()->id()]);
return redirect()->route('petani.index')->with('success', 'Data petani berhasil ditambahkan.');
return redirect()->route('petani.edit', $petani->id)->with('success', 'Data petani berhasil ditambahkan.');
}
public function show(string $id)
@@ -253,7 +253,7 @@ class PetaniController extends Controller
$petani->update([...$validatedData,
'updated_by' => auth()->id()]);
return redirect()->route('petani.index')->with('success', 'Data petani berhasil diupdate.');
return redirect()->route('petani.edit', $petani->id)->with('success', 'Data petani berhasil diupdate.');
}
/**
@@ -224,15 +224,15 @@ class PetaniLahanController extends Controller
if ($request->ajax()) {
return response()->json([
'success' => true,
'redirect' => route('petani.lahan-tanaman.index', $petaniId),
'redirect' => route('petani.lahan-tanaman.edit', [$petaniId, $lahan->id]),
'message' => 'Lahan berhasil ditambahkan.'
]);
}
return redirect()->route('petani.lahan-tanaman.index', $petaniId)->with('success', 'Lahan berhasil ditambahkan.');
return redirect()->route('petani.lahan-tanaman.edit', [$petaniId, $lahan->id])->with('success', 'Lahan berhasil ditambahkan.');
}
return redirect()->route('petani.lahan-tanaman.index', $petaniId)->with('success', 'Lahan berhasil ditambahkan.');
return redirect()->route('petani.lahan-tanaman.edit', [$petaniId, $lahan->id])->with('success', 'Lahan berhasil ditambahkan.');
}
public function show(string $petaniId, string $id)
@@ -371,12 +371,12 @@ class PetaniLahanController extends Controller
if ($request->ajax()) {
return response()->json([
'success' => true,
'redirect' => route('petani.lahan-tanaman.index', $petaniId),
'redirect' => route('petani.lahan-tanaman.edit', [$petaniId, $lahan->id]),
'message' => 'Lahan berhasil diupdate.'
]);
}
return redirect()->route('petani.lahan-tanaman.index', $petaniId)->with('success', 'Lahan berhasil diperbarui.');
return redirect()->route('petani.lahan-tanaman.edit', [$petaniId, $lahan->id])->with('success', 'Lahan berhasil diperbarui.');
}
public function destroy(string $id)
@@ -833,7 +833,7 @@
showConfirmButton: false,
timer: 1500
}).then(() => {
window.location.href = "{{ route('petani.index') }}";
window.location.href = res.redirect || window.location.href;
});
},
error: function(xhr) {
@@ -900,7 +900,7 @@
showConfirmButton: false,
timer: 1500
}).then(() => {
window.location.href = "{{ route('petani.index') }}";
window.location.href = res.redirect || window.location.href;
});
},
error: function(xhr) {