solve lahan & tanaman
This commit is contained in:
@@ -178,7 +178,7 @@ class PetaniController extends Controller
|
|||||||
'created_by' => auth()->id(),
|
'created_by' => auth()->id(),
|
||||||
'updated_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)
|
public function show(string $id)
|
||||||
@@ -253,7 +253,7 @@ class PetaniController extends Controller
|
|||||||
$petani->update([...$validatedData,
|
$petani->update([...$validatedData,
|
||||||
'updated_by' => auth()->id()]);
|
'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()) {
|
if ($request->ajax()) {
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'success' => true,
|
'success' => true,
|
||||||
'redirect' => route('petani.lahan-tanaman.index', $petaniId),
|
'redirect' => route('petani.lahan-tanaman.edit', [$petaniId, $lahan->id]),
|
||||||
'message' => 'Lahan berhasil ditambahkan.'
|
'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)
|
public function show(string $petaniId, string $id)
|
||||||
@@ -371,12 +371,12 @@ class PetaniLahanController extends Controller
|
|||||||
if ($request->ajax()) {
|
if ($request->ajax()) {
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'success' => true,
|
'success' => true,
|
||||||
'redirect' => route('petani.lahan-tanaman.index', $petaniId),
|
'redirect' => route('petani.lahan-tanaman.edit', [$petaniId, $lahan->id]),
|
||||||
'message' => 'Lahan berhasil diupdate.'
|
'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)
|
public function destroy(string $id)
|
||||||
|
|||||||
@@ -833,7 +833,7 @@
|
|||||||
showConfirmButton: false,
|
showConfirmButton: false,
|
||||||
timer: 1500
|
timer: 1500
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
window.location.href = "{{ route('petani.index') }}";
|
window.location.href = res.redirect || window.location.href;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
error: function(xhr) {
|
error: function(xhr) {
|
||||||
|
|||||||
@@ -900,7 +900,7 @@
|
|||||||
showConfirmButton: false,
|
showConfirmButton: false,
|
||||||
timer: 1500
|
timer: 1500
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
window.location.href = "{{ route('petani.index') }}";
|
window.location.href = res.redirect || window.location.href;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
error: function(xhr) {
|
error: function(xhr) {
|
||||||
|
|||||||
Reference in New Issue
Block a user