Compare commits

4 Commits
Author SHA1 Message Date
Syaharani 607533a327 Merge remote-tracking branch 'origin/main'
# Conflicts:
#	app/Http/Controllers/Web/Produktivitas/PetaniController.php
2026-09-22 11:02:02 +07:00
Syaharani 6b25bff2c4 Merge branch 'main' of https://git.probindo.com/Probindo/database-pertani-web 2026-09-22 10:59:55 +07:00
Syaharani 71b4d42ea2 Merge branch 'main' of https://git.probindo.com/Probindo/database-pertani-web 2026-09-22 10:58:41 +07:00
Syaharani c42a2571f5 solve profil petani 2026-09-22 10:57:21 +07:00
@@ -272,7 +272,17 @@ class PetaniController extends Controller
try { try {
$petani = Petani::findOrFail($id); $petani = Petani::findOrFail($id);
$petani->delete(); if (auth()->user()->role->value === 'fasilitator' && $petani->created_by !== auth()->id()) {
return response()->json(['message' => 'Anda tidak memiliki akses.'], 403);
}
DB::transaction(function () use ($petani) {
$petani->update([
'deleted_by' => auth()->id(),
]);
$petani->delete();
});
return response()->json([ return response()->json([
'status' => 'success', 'status' => 'success',